Skip to content

Commit

Permalink
Add tests with old reserved syntax as syntax-error tests
Browse files Browse the repository at this point in the history
  • Loading branch information
catamorphism committed Sep 19, 2024
1 parent 5c91977 commit bf9d4c5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions icu4c/source/test/intltest/messageformat2test_read_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ void TestMessageFormat2::jsonTestsFromFiles(IcuTestErrorCode& errorCode) {
// Do tests for reserved statements/expressions
runTestsFromJsonFile(*this, "spec/unsupported-expressions.json", errorCode);
runTestsFromJsonFile(*this, "spec/unsupported-statements.json", errorCode);
// Uncomment when reserved syntax is removed
// runTestsFromJsonFile(*this, "reserved-syntax-2.json", errorCode);

// Do valid spec tests
runTestsFromJsonFile(*this, "spec/syntax.json", errorCode);
Expand Down
17 changes: 13 additions & 4 deletions testdata/message2/reserved-syntax-2.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
{
"scenario": "Reserved and private annotations",
"description": "Tests for unsupported expressions (reserved/private) - ICU4J only. Remove this file when error handling is reconciled",
"description": "Tests for old unsupported expression (reserved/private) syntax -- these are now syntax errors",
"defaultTestProperties": {
"locale": "en-US"
"locale": "en-US",
"expErrors": [
{
"type": "syntax-error"
}
]
},
"tests": [
{ "src" : "\\\\{ ? 󗟋 𫓜|@} |}", "ignoreCpp": "This would be an error in ICU4C" },
{ "src" : "\\\\{ ? 󗟋 𫓜|@} | \\} @𠟅򑚎𥪙𽧫=|| @򒘒򳷦㥞򉊷=$򸚶񽱆񅗽񤕞 @𰺱:񎫛񢶛򶈎񄮒}", "ignoreCpp": "This would be an error in ICU4C" }
{ "src" : "\\\\{ ? 󗟋 𫓜|@} |}" },
{ "src" : "\\\\{ ? 󗟋 𫓜|@} | \\} @𠟅򑚎𥪙𽧫=|| @򒘒򳷦㥞򉊷=$򸚶񽱆񅗽񤕞 @𰺱:񎫛񢶛򶈎񄮒}" },
{ "src" : "{ $iFN ^ @USh =$u @l}" },
{ "src" : ".local $dS ={ $p4 ^ |.| \\\\ @g:FV = $kd}{{@}}" },
{ "src" : ".D. \\\\ ||{1}{{}} " },
{ "src" : ".cIT ||{|@| % \\} } { *󔜫񥘃󸇀 }{{}}" }
]
}

0 comments on commit bf9d4c5

Please sign in to comment.