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

echo -n $0: 'Min and max function... '

cat >test.bas <<'eof'
print min(1,2)
print min(2,1)
print min(-0.3,0.3)
print min(-0.3,4)
print max(1,2)
print max(2,1)
print max(-0.3,0.3)
print max(-0.3,4)
eof

cat >test.ref <<'eof'
 1 
 1 
-0.3 
-0.3 
 2 
 2 
 0.3 
 4 
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