summaryrefslogtreecommitdiff
path: root/apps/examples/bas/tests/test08.bas
blob: 82209c91b4213346669fbb701260504fe33412aa (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
#!/bin/sh

echo -n $0: 'DATA, READ and RESTORE... '

cat >test.bas <<eof
10 data "a",b
20 data "c","d
40 read j$
50 print "j=";j$
60 restore 20
70 for i=1 to 3
80 read j$,k$
90 print "j=";j$;" k=";k$
100 next
eof

cat >test.ref <<'eof'
j=a
j=c k=d
Error: end of `data' in line 80 at:
80 read j$,k$
        ^
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