Skip to content

Commit 0388514

Browse files
catamorphismeemeli
andauthored
Add syntax tests for unsupported expressions and statements (#843) (#851)
* Add syntax tests for unsupported expressions and statements (#843) * Update test/tests/unsupported-statements.json Co-authored-by: Eemeli Aro <[email protected]> --------- Co-authored-by: Eemeli Aro <[email protected]>
1 parent 22f5ac5 commit 0388514

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"scenario": "Reserved and private annotations",
3+
"description": "Tests for unsupported expressions (reserved/private)",
4+
"defaultTestProperties": {
5+
"locale": "en-US",
6+
"expErrors": [
7+
{
8+
"type": "unsupported-expression"
9+
}
10+
]
11+
},
12+
"tests": [
13+
{ "src": "hello {|4.2| %number}" },
14+
{ "src": "hello {|4.2| %n|um|ber}" },
15+
{ "src": "{+42}" },
16+
{ "src": "hello {|4.2| &num|be|r}" },
17+
{ "src": "hello {|4.2| ^num|be|r}" },
18+
{ "src": "hello {|4.2| +num|be|r}" },
19+
{ "src": "hello {|4.2| ?num|be||r|s}" },
20+
{ "src": "hello {|foo| !number}" },
21+
{ "src": "hello {|foo| *number}" },
22+
{ "src": "hello {?number}" },
23+
{ "src": "{<tag}" },
24+
{ "src": ".local $bar = {$none ~plural} .match {foo :string} * {{{$bar}}}" },
25+
{ "src": "hello {|4.2| %num\\\\ber}" },
26+
{ "src": "hello {|4.2| %num\\{be\\|r}" },
27+
{ "src": "hello {|4.2| %num\\\\\\}ber}" },
28+
{ "src": "hello {|4.2| !}" },
29+
{ "src": "hello {|4.2| %}" },
30+
{ "src": "hello {|4.2| *}" },
31+
{ "src": "hello {|4.2| ^abc|123||5|\\\\}" },
32+
{ "src": "hello {|4.2| ^ abc|123||5|\\\\}" },
33+
{ "src": "hello {|4.2| ^ abc|123||5|\\\\ \\|def |3.14||2|}" },
34+
{ "src": "hello {|4.2| ? }" },
35+
{ "src": "hello {|4.2| %xyzz }" },
36+
{ "src": "hello {|4.2| >xyzz }" },
37+
{ "src": "hello {$foo ~xyzz }" },
38+
{ "src": "hello {$x <xyzz }" },
39+
{ "src": "{>xyzz }" },
40+
{ "src": "{ !xyzz }" },
41+
{ "src": "{~xyzz }" },
42+
{ "src": "{ <xyzz }" },
43+
{ "src": "hello {|4.2| !xy z z }" },
44+
{ "src": "hello {|4.2| *num \\\\ b er}" },
45+
{ "src": "hello {|4.2| %num \\\\ b |3.14| r }" },
46+
{ "src": "hello {|4.2| +num xx \\\\ b |3.14| r }" },
47+
{ "src": "hello {$foo +num x \\\\ abcde |3.14| r }" },
48+
{ "src": "hello {$foo >num x \\\\ abcde |aaa||3.14||42| r }" },
49+
{ "src": "hello {$foo >num x \\\\ abcde |aaa||3.14| |42| r }" },
50+
{ "src" : ".input{ $n ~ }{{{$n}}}" }
51+
]
52+
}
53+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"scenario": "Reserved statements",
3+
"description": "Tests for unsupported statements",
4+
"defaultTestProperties": {
5+
"locale": "en-US",
6+
"expErrors": [
7+
{
8+
"type": "unsupported-statement"
9+
}
10+
]
11+
},
12+
"tests": [
13+
{ "src" : ".i {1} {{}}" },
14+
{ "src" : ".l $y = {|bar|} {{}}" },
15+
{ "src" : ".l $x.y = {|bar|} {{}}" }
16+
]
17+
}
18+

0 commit comments

Comments
 (0)