summaryrefslogtreecommitdiff
path: root/apps/examples/bas/tests/test29.bas
blob: 945f33e4d220a7f8daeccbd1b0ef2387bd49c796 (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: 'TDL INSTR... '

cat >test.bas <<'eof'
print instr("123456789","456");" = 4?"
print INSTR("123456789","654");" = 0?"
print INSTR("1234512345","34");" = 3?"
print INSTR("1234512345","34",6);" = 8?"
print INSTR("1234512345","34",6,2);" = 0?"
print INSTR("1234512345","34",6,4);" = 8?"
eof

cat >test.ref <<'eof'
 4  = 4?
 0  = 0?
 3  = 3?
 8  = 8?
 0  = 0?
 8  = 8?
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