Skip to content

Commit acea092

Browse files
committed
Add test coverage for many extra integer functions and exception values.
1 parent d6e11c8 commit acea092

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

testsuite/tests/misc-int.bas

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
' Test for statement ""
2+
? "Start"
3+
A=0
4+
? SGN(A)
5+
A=123
6+
? SGN(A)
7+
A=-512
8+
? SGN(A)
9+
A=1234
10+
B=1234
11+
? A/B
12+
A=-123
13+
B=5
14+
? A/B, A MOD B
15+
A=123
16+
B=-5
17+
? A/B, A MOD B
18+
A=0
19+
B=0
20+
? A/B, A MOD B
21+
A=VAL("66500") : B=ERR()
22+
? A, B
23+
' Test integer overflow conditions in comparisons:
24+
? -20000 < 15000, -10000 < 15000, -20000 < -30000, -20000 < -15000
25+
? 20000 < 15000, 10000 < 15000, 20000 < -30000, 20000 < -15000
26+
? -20000 > 15000, -10000 > 15000, -20000 > -30000, -20000 > -15000
27+
? 20000 > 15000, 10000 > 15000, 20000 > -30000, 20000 > -15000
28+
' Test for strings > 128 characters into VAL
29+
S$="000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000123400000000000000"
30+
? VAL(S$)

testsuite/tests/misc-int.chk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Name: Test miscellaneous integer functions
2+
Test: run
3+
Output:
4+
Start
5+
0
6+
1
7+
-1
8+
1
9+
-24 -3
10+
-24 3
11+
-1 0
12+
771 18
13+
1 1 0 1
14+
0 1 0 0
15+
0 0 1 0
16+
1 0 1 1
17+
12340

0 commit comments

Comments
 (0)