summaryrefslogtreecommitdiff
path: root/apps/interpreters/bas/test/test28
blob: fa22845bb0ed575a3ac3101f9dc4f726a7353f45 (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
#!/bin/sh

echo -n $0: 'TDL BASIC FNRETURN/FNEND... '

cat >test.bas <<'eof'
def fnfac(n)
  if n=1 then fnreturn 1
fnend n*fnfac(n-1)

print fnfac(10)
eof

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