assert multimethod
Methods
- assert(condition:Bool, msg:Str) Source: stdlib.ngs:71
Throws AssertFail with givens message if condition is false Returns
Unspecified, do not count on this valueExample
my_array=[] # ... Code that adds elements to my_array ... assert(my_array.len() > 3, "my_array must have more than 3 elements") # AssertFail exception, with the given message
- assert(condition:Bool) Source: stdlib.ngs:78
Throws AssertFail if condition is false Returns
Unspecified, do not count on this valueExample
my_array=[] # ... Code that adds elements to my_array ... assert(my_array.len() > 3) # AssertFail exception, with "Assertion failed" message
- assert(condition:Any, *args:Arr) Source: stdlib.ngs:86
Throws AssertFail if condition, after conversion to Bool is false. Same as super(Bool(condition), *args) . Parameters
condition not Bool Returns
Unspecified, do not count on this valueExample
assert(my_array, "my_array must have elements at this point")