summaryrefslogtreecommitdiff
path: root/apps/examples/bas/tests/test23.bas
diff options
context:
space:
mode:
Diffstat (limited to 'apps/examples/bas/tests/test23.bas')
-rw-r--r--apps/examples/bas/tests/test23.bas40
1 files changed, 40 insertions, 0 deletions
diff --git a/apps/examples/bas/tests/test23.bas b/apps/examples/bas/tests/test23.bas
new file mode 100644
index 000000000..60b37da89
--- /dev/null
+++ b/apps/examples/bas/tests/test23.bas
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+echo -n $0: 'Matrix addition and subtraction... '
+
+cat >test.bas <<'eof'
+dim a(2,2)
+a(2,2)=2.5
+dim b%(2,2)
+b%(2,2)=3
+mat print a
+mat a=a-b%
+mat print a
+dim c$(2,2)
+c$(2,1)="hi"
+mat print c$
+mat c$=c$+c$
+mat print c$
+eof
+
+cat >test.ref <<'eof'
+ 0 0
+ 0 2.5
+ 0 0
+ 0 -0.5
+
+hi
+
+hihi
+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