1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#!./yabasic
for n=1 to 2
restore number
for a=1 to 2
read expr$,result
found = eval(expr$)
if found <> result then
print "Expression " + expr$ + " should eval to " + str$(result) + " but gave " + str$(found)
exit 1
endif
next a
next n
for n=1 to 2
restore string
for a=1 to 2
read expr$,result$
found$ = eval$(expr$)
if found$ <> result$ then
print "Expression " + expr$ + " should eval to " + result$ + " but gave " + found$
exit 1
endif
next a
next n
label number
data "1+2",3,"2+3",5
label string
data "\"foo\" + \"bar\"","foobar","left$(\"foo\",1)","f"
|