summaryrefslogtreecommitdiff
path: root/apps/interpreters/bas/test/test39
blob: 25c33d475ecde2bc5c5462d6e526bf0a5528cf76 (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: 'Nested function and procedure calls... '

cat >test.bas <<'eof'
def proc_a(x)
print fn_b(1,x)
end proc

def fn_b(a,b)
= a+fn_c(b)

def fn_c(b)
= b+3

proc_a(2)
eof

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