summaryrefslogtreecommitdiff
path: root/apps/examples/bas/tests/test17.bas
blob: 544e790f8646510741a3ebbebb8f8ff83cf5ba5b (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
33
34
35
36
37
38
39
40
#!/bin/sh

echo -n $0: 'DO, EXIT DO, LOOP... '

cat >test.bas <<'eof'
print "loop started"
i=1
do
  print "i is";i
  i=i+1
  if i>10 then exit do
loop
print "loop ended"
eof

cat >test.ref <<'eof'
loop started
i is 1 
i is 2 
i is 3 
i is 4 
i is 5 
i is 6 
i is 7 
i is 8 
i is 9 
i is 10 
loop ended
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