Assertions: Difference between revisions
Content added Content deleted
No edit summary |
(Added BASIC256) |
||
Line 205: | Line 205: | ||
Now, expect a failure, unless NDEBUG defined at compile time |
Now, expect a failure, unless NDEBUG defined at compile time |
||
41</pre> |
41</pre> |
||
=={{header|BASIC256}}== |
|||
{{works with|BASIC256|2.0.0.11}} |
|||
<lang BASIC256> |
|||
subroutine assert (condition, message) |
|||
if not condition then print "ASSERTION FAIED: ";message: throwerror 1 |
|||
end subroutine |
|||
call assert(1+1=2, "but I don't expect this assertion to fail"): rem Does not throw an error |
|||
rem call assert(1+1=3, "and rightly so"): rem Throws an error |
|||
</lang> |
|||
=={{header|BBC BASIC}}== |
=={{header|BBC BASIC}}== |