summaryrefslogtreecommitdiff
path: root/apps/examples/bas/tests/test10.bas
blob: 35d65ca4a5651d46d41963c73384cbdf4be231cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/sh

echo -n $0: 'PRINT USING... '

cat >test.bas <<'eof'
 10 print using "!";"abcdef"
 20 print using "\ \";"abcdef"
 30 print using "###-";-1
 40 print using "###-";0
 50 print using "###-";1
 60 print using "###+";-1
 70 print using "###+";0
 80 print using "###+";1
 90 print using "#####,";1000
100 print using "**#,##.##";1000.00
110 print using "+##.##";1
120 print using "+##.##";1.23400
130 print using "+##.##";123.456
140 print using "+##.";123.456
150 print using "+##";123.456
160 print using "abc def ###.## efg";1.3
170 print using "###.##^^^^^";5
180 print using "###.##^^^^";1000
190 print using ".##^^^^";5.0
200 print using "##^^^^";2.3e-9
210 print using ".##^^^^";2.3e-9
220 print using "#.#^^^^";2.3e-9
230 print using ".####^^^^^";-011466
240 print using "$*,***,***,***.**";3729825.24
250 print using "$**********.**";3729825.24
260 print using "$$###.##";456.78
270 print using "a!b";"S"
280 print using "a!b";"S","T"
290 print using "a!b!c";"S"
300 print using "a!b!c";"S","T"
eof

cat >test.ref <<'eof'
a
abc
  1-
  0 
  1 
  1-
  0+
  1+
 1,000
*1,000.00
 +1.00
 +1.23
+123.46
+123.
+123
abc def   1.30 efg
500.00E-002
100.00E+01
.50E+01
23E-10
.23E-08
2.3E-09
-.1147E+005
$***3,729,825.24
$**3729825.24
$456.78
aSb
aSbaTb
aSb
aSbTc
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