Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add syntax tests for unsupported expressions and statements (#843) #851

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions test/tests/unsupported-expressions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"scenario": "Reserved and private annotations",
"description": "Tests for unsupported expressions (reserved/private)",
"defaultTestProperties": {
"locale": "en-US",
"expErrors": [
{
"type": "unsupported-expression"
}
]
},
"tests": [
{ "src": "hello {|4.2| %number}" },
{ "src": "hello {|4.2| %n|um|ber}" },
{ "src": "{+42}" },
{ "src": "hello {|4.2| &num|be|r}" },
{ "src": "hello {|4.2| ^num|be|r}" },
{ "src": "hello {|4.2| +num|be|r}" },
{ "src": "hello {|4.2| ?num|be||r|s}" },
{ "src": "hello {|foo| !number}" },
{ "src": "hello {|foo| *number}" },
{ "src": "hello {?number}" },
{ "src": "{<tag}" },
{ "src": ".local $bar = {$none ~plural} .match {foo :string} * {{{$bar}}}" },
{ "src": "hello {|4.2| %num\\\\ber}" },
{ "src": "hello {|4.2| %num\\{be\\|r}" },
{ "src": "hello {|4.2| %num\\\\\\}ber}" },
{ "src": "hello {|4.2| !}" },
{ "src": "hello {|4.2| %}" },
{ "src": "hello {|4.2| *}" },
{ "src": "hello {|4.2| ^abc|123||5|\\\\}" },
{ "src": "hello {|4.2| ^ abc|123||5|\\\\}" },
{ "src": "hello {|4.2| ^ abc|123||5|\\\\ \\|def |3.14||2|}" },
{ "src": "hello {|4.2| ? }" },
{ "src": "hello {|4.2| %xyzz }" },
{ "src": "hello {|4.2| >xyzz }" },
{ "src": "hello {$foo ~xyzz }" },
{ "src": "hello {$x <xyzz }" },
{ "src": "{>xyzz }" },
{ "src": "{ !xyzz }" },
{ "src": "{~xyzz }" },
{ "src": "{ <xyzz }" },
{ "src": "hello {|4.2| !xy z z }" },
{ "src": "hello {|4.2| *num \\\\ b er}" },
{ "src": "hello {|4.2| %num \\\\ b |3.14| r }" },
{ "src": "hello {|4.2| +num xx \\\\ b |3.14| r }" },
{ "src": "hello {$foo +num x \\\\ abcde |3.14| r }" },
{ "src": "hello {$foo >num x \\\\ abcde |aaa||3.14||42| r }" },
{ "src": "hello {$foo >num x \\\\ abcde |aaa||3.14| |42| r }" },
{ "src" : ".input{ $n ~ }{{{$n}}}" }
]
}

17 changes: 17 additions & 0 deletions test/tests/unsupported-statements.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"scenario": "Reserved statements",
"description": "Tests for unsupported statements",
"defaultTestProperties": {
"locale": "en-US",
"expErrors": [
{
"type": "unsupported-statement"
}
]
},
"tests": [
{ "src" : ".i {1} {{}}" },
{ "src" : ".l $y = {|bar|} {{}}" }
catamorphism marked this conversation as resolved.
Show resolved Hide resolved
]
}