summaryrefslogtreecommitdiff
path: root/apps/interpreters/bas/test/test22
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/test22
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/test22')
-rw-r--r--apps/interpreters/bas/test/test2240
1 files changed, 40 insertions, 0 deletions
diff --git a/apps/interpreters/bas/test/test22 b/apps/interpreters/bas/test/test22
new file mode 100644
index 000000000..73e2317f9
--- /dev/null
+++ b/apps/interpreters/bas/test/test22
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+echo -n $0: 'MAT PRINT... '
+
+cat >test.bas <<'eof'
+dim a(2,2)
+for i=0 to 2
+ for j=0 to 2
+ a(i,j)=i*10+j
+ next
+next
+for j=1 to 2
+ for i=1 to 2
+ print using " ##.##";a(i,j),
+ next
+ print
+next
+mat print using " ##.##";a,a
+eof
+
+cat >test.ref <<'eof'
+ 11.00 21.00
+ 12.00 22.00
+ 11.00 12.00
+ 21.00 22.00
+
+ 11.00 12.00
+ 21.00 22.00
+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