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

15 lines
230 B
Plaintext

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