summaryrefslogtreecommitdiff
path: root/apps/interpreters/bas/test/test06
blob: 8a5402d040d01ce4589ce729beab9e4eb02aacf0 (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
41
42
#!/bin/sh

echo -n $0: 'Recursive function without arguments... '

cat >test.bas <<eof
10 def fnloop
20   if n=0.0 then
30     r=0.0
40   else
50     print n
60     n=n-1.0
70     r=fnloop()
80   end if
90 =r
100 n=10
110 print fnloop
eof

cat >test.ref <<eof
 10 
 9 
 8 
 7 
 6 
 5 
 4 
 3 
 2 
 1 
 0 
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