summaryrefslogtreecommitdiff
path: root/apps/examples/bas/tests/test27.bas
blob: f90c0c2361ce508383a6d249bbaa0d88f270dd72 (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
#!/bin/sh

echo -n $0: 'Matrix inversion... '

cat >test.bas <<'eof'
data 1,2,3,4
mat read a(2,2)
mat print a
mat b=inv(a)
mat print b
mat c=a*b
mat print c
eof

cat >test.ref <<'eof'
 1             2            
 3             4            
-2             1            
 1.5          -0.5          
 1             0            
 0             1            
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