From 03cba1fb99b57b9c13773e99556e151d04c5155c Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 9 Dec 2024 10:17:31 -0800 Subject: [PATCH] Fix tests for new match syntax --- icu4c/source/i18n/messageformat2_parser.cpp | 2 +- testdata/message2/bidi.json | 10 +++++----- testdata/message2/matches-whitespace.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/icu4c/source/i18n/messageformat2_parser.cpp b/icu4c/source/i18n/messageformat2_parser.cpp index 529144f024c0..724b8f6b3e94 100644 --- a/icu4c/source/i18n/messageformat2_parser.cpp +++ b/icu4c/source/i18n/messageformat2_parser.cpp @@ -2022,7 +2022,7 @@ void Parser::parseSelectors(UErrorCode& status) { return; } - while (isWhitespace(peek()) || isBidiControl(peek()) isKeyStart(peek())) { + while (isWhitespace(peek()) || isBidiControl(peek()) || isKeyStart(peek())) { parseOptionalWhitespace(); // Restore the precondition. // Trailing whitespace is allowed. diff --git a/testdata/message2/bidi.json b/testdata/message2/bidi.json index 5979f385f154..0654befba25b 100644 --- a/testdata/message2/bidi.json +++ b/testdata/message2/bidi.json @@ -54,7 +54,7 @@ { "comment": "match-statement s variant *(o variant)", "src": [".local $x = {1 :number}\n", - ".match {$x}\n", + ".match $x\n", "1 {{one}}\n", "\u061C * {{other}}"], "exp": "one" @@ -62,7 +62,7 @@ { "comment": "match-statement s variant *(o variant)", "src": [".local $x = {1 :number}", - ".match {$x} \u061c", + ".match $x \u061c", "1 {{one}}", "* {{other}}"], "exp": "one" @@ -70,7 +70,7 @@ { "comment": "match-statement s variant *(o variant)", "src": [".local $x = {1 :number}", - ".match {$x}\u061c", + ".match $x \u061c", "1 {{one}}", "* {{other}}"], "exp": "one" @@ -78,7 +78,7 @@ { "comment": "variant = key *(s key) quoted-pattern", "src": [".local $x = {1 :number} .local $y = {$x :number}", - ".match {$x} {$y}", + ".match $x $y\n", "1 \u200E 1 {{one}}", "* * {{other}}"], "exp": "one" @@ -86,7 +86,7 @@ { "comment": "variant = key *(s key) quoted-pattern", "src": [".local $x = {1 :number} .local $y = {$x :number}", - ".match {$x} {$y}", + ".match $x $y\n", "1\u200E 1 {{one}}", "* * {{other}}"], "exp": "one" diff --git a/testdata/message2/matches-whitespace.json b/testdata/message2/matches-whitespace.json index 2255a0203bb7..fd4b2b2ced15 100644 --- a/testdata/message2/matches-whitespace.json +++ b/testdata/message2/matches-whitespace.json @@ -6,7 +6,7 @@ }, "tests": [ { "src": ".local $one = {1 :string} .local $bar = {bar :string} .match $one $bar one * {{one}} * * {{other}}", - "exp": "one" }, + "exp": "other" }, { "src": ".local $foo = {foo :string} .local $bar = {bar :string} .match $foo $bar one * {{one}}* * {{other}}", "exp": "other" }, { "src": ".local $foo = {foo :string} .local $bar = {bar :string} .match $foo $bar one *{{one}} * * {{foo}}",