Created
June 14, 2019 22:26
-
-
Save joseoliv/df12bbc3c33cee07f0cef7faec0fa129 to your computer and use it in GitHub Desktop.
assert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metaobjectTest | |
@doc{* | |
Macro 'assert' has the following syntax: | |
assert expr; | |
'assert' is a macro keyword and 'expr' a Cyan expression. A ';' | |
should end the macro call. | |
At runtime, if 'expr' is false, an error message is issued. | |
The program is NOT terminated. | |
*} | |
object Assert | |
func run { | |
assert "This message should be printed" == ""; | |
assert "Do not print this" size > 10; | |
assert 0 == 0; | |
assert " "*3 == " "; | |
} | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment