summaryrefslogtreecommitdiff
path: root/apps/interpreters/bas/test/test27
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-10-27 07:53:12 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-10-27 07:53:12 -0600
commit4ef5633f361ab5302007045dcef945043d6d6225 (patch)
tree1806fe0ec9221c4e6c7439419e8b57bfe7865d29 /apps/interpreters/bas/test/test27
parentf2fe892334074612e4e3159c754b65d13bc348fc (diff)
downloadpx4-nuttx-4ef5633f361ab5302007045dcef945043d6d6225.tar.gz
px4-nuttx-4ef5633f361ab5302007045dcef945043d6d6225.tar.bz2
px4-nuttx-4ef5633f361ab5302007045dcef945043d6d6225.zip
Port of BAS 2.4 to NuttX by Alan Carvalho de Assis
Diffstat (limited to 'apps/interpreters/bas/test/test27')
-rw-r--r--apps/interpreters/bas/test/test2733
1 files changed, 33 insertions, 0 deletions
diff --git a/apps/interpreters/bas/test/test27 b/apps/interpreters/bas/test/test27
new file mode 100644
index 000000000..f90c0c236
--- /dev/null
+++ b/apps/interpreters/bas/test/test27
@@ -0,0 +1,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