RosettaCodeData/Task/Assertions/Liberty-BASIC/assertions.liberty

15 lines
230 B
Text
Raw Permalink Normal View History

2014-01-17 05:32:22 +00:00
a=42
call assert a=42
print "passed"
a=41
call assert a=42
print "failed (we never get here)"
end
sub assert cond
if cond=0 then 'simulate error, mentioning "AssertionFailed"
AssertionFailed(-1)=0
end if
end sub