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

echo -n $0: 'SUB routines... '

cat >test.bas <<'eof'
PUTS("abc")
END

SUB PUTS(s$)
  FOR i=1 to LEN(s$) : print mid$(s$,i,1); : NEXT
  PRINT
END SUB
eof

cat >test.ref <<'eof'
abc
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