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

15 lines
230 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04: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