From 36887d124af291dc54c6bb2ab849d8d7e3ca2899 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Wed, 31 Jul 2024 15:58:47 -0700 Subject: [PATCH] Add syntax tests for unsupported expressions and statements (#843) --- test/tests/unsupported-expressions.json | 53 +++++++++++++++++++++++++ test/tests/unsupported-statements.json | 17 ++++++++ 2 files changed, 70 insertions(+) create mode 100644 test/tests/unsupported-expressions.json create mode 100644 test/tests/unsupported-statements.json diff --git a/test/tests/unsupported-expressions.json b/test/tests/unsupported-expressions.json new file mode 100644 index 000000000..f7d611509 --- /dev/null +++ b/test/tests/unsupported-expressions.json @@ -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": "{xyzz }" }, + { "src": "hello {$foo ~xyzz }" }, + { "src": "hello {$x xyzz }" }, + { "src": "{ !xyzz }" }, + { "src": "{~xyzz }" }, + { "src": "{ num x \\\\ abcde |aaa||3.14||42| r }" }, + { "src": "hello {$foo >num x \\\\ abcde |aaa||3.14| |42| r }" }, + { "src" : ".input{ $n ~ }{{{$n}}}" } + ] +} + diff --git a/test/tests/unsupported-statements.json b/test/tests/unsupported-statements.json new file mode 100644 index 000000000..da79fff91 --- /dev/null +++ b/test/tests/unsupported-statements.json @@ -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|} {{}}" } + ] +} +