Skip to content

Instantly share code, notes, and snippets.

@joseoliv joseoliv/Assert.cyan
Created Jun 14, 2019

Embed
What would you like to do?
assert
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
You can’t perform that action at this time.