' ASSERT Demo — Debug assertions
#COMPILE EXE
#DIM ALL

FUNCTION PBMAIN() AS LONG
    LOCAL x AS LONG
    LOCAL y AS LONG
    LOCAL ok AS LONG

    x = 10
    y = 20
    ok = 1

    IF (1 = 1) = 0 THEN PRINT "Assert failed" : ok = 0
    PRINT "Basic assertion passed"

    IF (x < y) = 0 THEN PRINT "Assert failed" : ok = 0
    PRINT "Value assertion passed"

    x = x + y
    IF (x = 30) = 0 THEN PRINT "Assert failed" : ok = 0
    PRINT "Computed assertion passed"

    PRINT "All assertions OK"
    FUNCTION = 0
END FUNCTION
