RosettaCodeData/Task/Assertions/BASIC256/assertions.basic
2023-07-01 13:44:08 -04:00

6 lines
281 B
Text

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