summaryrefslogtreecommitdiff
path: root/apps/examples/bas/tests/test34.bas
diff options
context:
space:
mode:
Diffstat (limited to 'apps/examples/bas/tests/test34.bas')
-rw-r--r--apps/examples/bas/tests/test34.bas43
1 files changed, 43 insertions, 0 deletions
diff --git a/apps/examples/bas/tests/test34.bas b/apps/examples/bas/tests/test34.bas
new file mode 100644
index 000000000..0419284d8
--- /dev/null
+++ b/apps/examples/bas/tests/test34.bas
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+echo -n $0: 'OPTION BASE... '
+
+cat >test.bas <<'eof'
+option base 3
+dim a(3,5)
+a(3,3)=1
+a(3,5)=2
+
+print a(3,3)
+print a(3,5)
+
+option base -2
+dim b(-1,2)
+b(-2,-2)=10
+b(-1,2)=20
+
+print a(3,3)
+print a(3,5)
+print b(-2,-2)
+print b(-1,2)
+eof
+
+cat >test.ref <<'eof'
+ 1
+ 2
+ 1
+ 2
+ 10
+ 20
+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