summaryrefslogtreecommitdiff
path: root/apps/examples/bas/tests/test41.bas
blob: 58bc28c740b3881b7a249231c81204a4196924b5 (plain) (blame)
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
31
32
#!/bin/sh

echo -n $0: 'EXIT FUNCTION... '

cat >test.bas <<'eof'
function f(c)
print "f running"
if (c) then f=42 : exit function
f=43
end function

print f(0)
print f(1)
eof

cat >test.ref <<'eof'
f running
 43 
f running
 42 
eof

sh ./test/runbas test.bas >test.data

if cmp test.ref test.data
then
  rm -f test.*
  echo passed
else
  echo failed
  exit 1
fi