-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathtest_misc.dao
122 lines (94 loc) · 1.87 KB
/
test_misc.dao
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
@[test(code_01)]
a : array<any>
@[test(code_01)]
@[test(output_01)]
Invalid %s type %s form
@[test(output_01)]
@[test(code_02)]
a : array<string>
@[test(code_02)]
@[test(output_02)]
Invalid %s type %s form
@[test(output_02)]
#{
DecDigit ::= '0' ... '9'
HexDigit ::= DecDigit | 'a' ... 'f' | 'A' ... 'F'
DecInteger ::= DecDigit +
HexInteger ::= ('0x' | '0X') DecDigit +
Integer ::= DecInteger | HexInteger
#}
@[test(code_03)]
io.writef( "%g", .5 )
@[test(code_03)]
@[test(code_03)]
0.5
@[test(code_03)]
@[test(code_03)]
io.writef( "%g", 123. )
@[test(code_03)]
@[test(code_03)]
123
@[test(code_03)]
@[test(code_03)]
12a
@[test(code_03)]
@[test(code_03)]
Invalid %s token
@[test(code_03)]
@[test(code_03)]
0x
@[test(code_03)]
@[test(code_03)]
Invalid %s token
@[test(code_03)]
@[test(code_03)]
0xh
@[test(code_03)]
@[test(code_03)]
Invalid %s token
@[test(code_03)]
# Incomplete string:
@[test(code_03)]
"incomplete string
@[test(code_03)]
@[test(code_03)]
Invalid %s token
@[test(code_03)]
# Incomplete string:
@[test(code_03)]
"incomplete string
@[test(code_03)]
@[test(code_03)]
Invalid %s token
@[test(code_03)]
# Test tail call optimization:
@[test(code_03)]
routine TestTailCall( n = 0 )
{
if( n == 0 ) std.error( "test" )
TestTailCall( n - 1 )
}
TestTailCall( 5 )
@[test(code_03)]
# If broken, it will print multiple "Called by: TestTailCall()"
@[test(code_03)]
{{Exception}} [^%n]* %n
[^%n]* %n
{{Raised by:}} [^%n]* %n
{{In code snippet:}} [^%n]* %n
[^%n]* {{GETCL}} [^%n]* %n
[^%n]* {{MCALL}} [^%n]* %n
[^%n]* {{GETCG}} [^%n]* %n
{{Called by: TestTailCall()}} [^%n]* %s*
{{Called by: __main__()}} [^%n]* %s*
@[test(code_03)]
@[test(code_01)]
std.try{ std.load( "WrongModule" ) }
std.load( "WrongModule" )
@[test(code_01)]
@[test(code_01)]
{{ERROR}} .*
{{Invalid number of parameter}} .*
{{ERROR}} .*
{{Invalid number of parameter}} .*
@[test(code_01)]