Skip to content

Instantly share code, notes, and snippets.

@PavelGnatyuk
Created July 3, 2018 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PavelGnatyuk/893cf81b11766fb22a9bf0a929e4172a to your computer and use it in GitHub Desktop.
Save PavelGnatyuk/893cf81b11766fb22a9bf0a929e4172a to your computer and use it in GitHub Desktop.
func assert(_ condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String) {
if condition() {
print(message())
}
}
func conditionOne() -> Bool {
return true
}
func phrase() -> String {
return "Text"
}
assert(true, "Hello")
assert(false, "Good bye")
assert(conditionOne(), phrase())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment