summaryrefslogtreecommitdiff
path: root/apps/examples/bas/tests/test43.bas
diff options
context:
space:
mode:
Diffstat (limited to 'apps/examples/bas/tests/test43.bas')
-rw-r--r--apps/examples/bas/tests/test43.bas41
1 files changed, 41 insertions, 0 deletions
diff --git a/apps/examples/bas/tests/test43.bas b/apps/examples/bas/tests/test43.bas
new file mode 100644
index 000000000..56d993a0f
--- /dev/null
+++ b/apps/examples/bas/tests/test43.bas
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+echo -n $0: 'Matrix multiplication size checks... '
+
+cat >test.bas <<eof
+DIM a(3,3),b(3,1),c(3,3)
+MAT READ a
+MAT READ b
+MAT c=a*b
+MAT PRINT c
+DATA 1,2,3,4,5,6,7,8,9
+DATA 5,3,2
+
+erase b
+DIM b(3)
+RESTORE
+MAT READ a
+MAT READ b
+MAT c=a*b
+MAT PRINT c
+eof
+
+cat >test.ref <<eof
+ 17
+ 47
+ 77
+Error: Dimension mismatch in line 14 at:
+mat c=a*b
+ ^
+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