File: bugs12.bas

package info (click to toggle)
zmakebas 1.2b-0.1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 128 kB
  • sloc: ansic: 787; makefile: 29; sh: 23
file content (24 lines) | stat: -rw-r--r-- 878 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Tests for various version 1.2/1.2a bugs since fixed.
# Does DEF FN, VAL$, and line-continuation at EOF.
#
# (See e.g. https://bugs.launchpad.net/ubuntu/+source/zmakebas/+bug/1908289
# for more on 1.2's DEF FN bug.)
#
# The last line intentionally ends with a backslash, it's one of the
# bug tests. If that hangs it, remove to check the others. If you do
# that then try the output from 1.2 (not 1.2a), RUN will give "Q
# Parameter error", as will GO TO 50 and GO TO 60. GO TO 70 will give
# "C Nonsense in BASIC".
#
# 1.2a will give multiple question marks from line 90's LIST.

10 def fn a(x)=x*x
20 def fn b(x,y)=x*y
30 def fn a$(x$)=x$+x$
40 print fn a(2);" should be 4"
50 print fn b(2,3);" should be 6"
60 print fn a$("foo");" should be foofoo"
70 print val$ """foo""+""bar""";" should be foobar"
80 print '"Should LIST 100 with no ?:"''
90 list 100
100 def fn c()=(0)\