Skip to content

Commit b2a0e4d

Browse files
committed
Update spec tests to revision 944804044f47de11ee6db496330aaa9c203aae61 of message-format-wg repo
1 parent 3331aca commit b2a0e4d

File tree

16 files changed

+150
-334
lines changed

16 files changed

+150
-334
lines changed

icu4c/source/test/intltest/messageformat2test_read_json.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ void TestMessageFormat2::jsonTestsFromFiles(IcuTestErrorCode& errorCode) {
313313
runTestsFromJsonFile(*this, "spec/syntax.json", errorCode);
314314
runTestsFromJsonFile(*this, "spec/fallback.json", errorCode);
315315
runTestsFromJsonFile(*this, "spec/pattern-selection.json", errorCode);
316+
runTestsFromJsonFile(*this, "spec/bidi.json", errorCode);
317+
runTestsFromJsonFile(*this, "spec/u-options.json", errorCode);
316318

317319
// Do valid function tests
318320
runTestsFromJsonFile(*this, "spec/functions/date.json", errorCode);
@@ -323,12 +325,6 @@ void TestMessageFormat2::jsonTestsFromFiles(IcuTestErrorCode& errorCode) {
323325
runTestsFromJsonFile(*this, "spec/functions/time.json", errorCode);
324326

325327
// Other tests (non-spec)
326-
// TODO: https://github.com/unicode-org/message-format-wg/pull/902 will
327-
// move the bidi tests into the spec
328-
runTestsFromJsonFile(*this, "bidi.json", errorCode);
329-
// TODO: move this into the spec tests when
330-
// https://github.com/unicode-org/message-format-wg/pull/846 lands
331-
runTestsFromJsonFile(*this, "u-options.json", errorCode);
332328
runTestsFromJsonFile(*this, "more-functions.json", errorCode);
333329
runTestsFromJsonFile(*this, "valid-tests.json", errorCode);
334330
runTestsFromJsonFile(*this, "resolution-errors.json", errorCode);
@@ -367,6 +363,8 @@ void TestMessageFormat2::jsonTestsFromFiles(IcuTestErrorCode& errorCode) {
367363
runTestsFromJsonFile(*this, "icu-parser-tests.json", errorCode);
368364
runTestsFromJsonFile(*this, "icu-test-selectors.json", errorCode);
369365
runTestsFromJsonFile(*this, "icu-test-previous-release.json", errorCode);
366+
367+
// TODO (not yet implemented): currency, math (but math might be removed?)
370368
}
371369

372370
#endif /* #if !UCONFIG_NO_MF2 */

testdata/message2/bidi.json

Lines changed: 0 additions & 160 deletions
This file was deleted.

testdata/message2/spec/bidi.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "../schemas/v0/tests.schema.json",
23
"scenario": "Bidi support",
34
"description": "Tests for correct parsing of messages with bidirectional marks and isolates",
45
"defaultTestProperties": {
@@ -113,12 +114,12 @@
113114
"exp": "1"
114115
},
115116
{
116-
"description": " name... excludes U+FFFD and U+061C -- this pases as name -> [bidi] name-start *name-char",
117+
"description": "name... excludes bidi formatting character U+061C -- this parses as name -> [bidi] name-start *name-char",
117118
"src": ".local $\u061Cfoo = {1} {{ {$\u061Cfoo} }}",
118119
"exp": " \u20681\u2069 "
119120
},
120121
{
121-
"description": " name matches https://www.w3.org/TR/REC-xml-names/#NT-NCName but excludes U+FFFD and U+061C",
122+
"description": "name excludes bidi formatting character U+061C",
122123
"src": ".local $foo\u061Cbar = {2} {{ }}",
123124
"expErrors": [{"type": "syntax-error"}]
124125
},

testdata/message2/spec/data-model-errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/unicode-org/message-format-wg/main/test/schemas/v0/tests.schema.json",
2+
"$schema": "../schemas/v0/tests.schema.json",
33
"scenario": "Data model errors",
44
"defaultTestProperties": {
55
"locale": "en-US"

testdata/message2/spec/fallback.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/unicode-org/message-format-wg/main/test/schemas/v0/tests.schema.json",
2+
"$schema": "../schemas/v0/tests.schema.json",
33
"scenario": "Fallback",
44
"description": "Test cases for fallback behaviour.",
55
"defaultTestProperties": {
@@ -11,7 +11,8 @@
1111
{
1212
"description": "function with unquoted literal operand",
1313
"src": "{42 :test:function fails=format}",
14-
"exp": "{|42|}"
14+
"exp": "{|42|}",
15+
"expParts": [{ "type": "fallback", "source": "|42|" }]
1516
},
1617
{
1718
"description": "function with quoted literal operand",
@@ -26,7 +27,8 @@
2627
{
2728
"description": "annotated implicit input variable",
2829
"src": "{$var :number}",
29-
"exp": "{$var}"
30+
"exp": "{$var}",
31+
"expParts": [{ "type": "fallback", "source": "$var" }]
3032
},
3133
{
3234
"description": "local variable with unknown function in declaration",
@@ -46,7 +48,8 @@
4648
{
4749
"description": "function with no operand",
4850
"src": "{:test:undefined}",
49-
"exp": "{:test:undefined}"
51+
"exp": "{:test:undefined}",
52+
"expParts": [{ "type": "fallback", "source": ":test:undefined" }]
5053
}
5154
]
5255
}

testdata/message2/spec/functions/date.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/unicode-org/message-format-wg/main/test/schemas/v0/tests.schema.json",
2+
"$schema": "../../schemas/v0/tests.schema.json",
33
"scenario": "Date function",
44
"description": "The built-in formatter for dates.",
55
"defaultTestProperties": {

testdata/message2/spec/functions/datetime.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/unicode-org/message-format-wg/main/test/schemas/v0/tests.schema.json",
2+
"$schema": "../../schemas/v0/tests.schema.json",
33
"scenario": "Datetime function",
44
"description": "The built-in formatter for datetimes.",
55
"defaultTestProperties": {

testdata/message2/spec/functions/integer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/unicode-org/message-format-wg/main/test/schemas/v0/tests.schema.json",
2+
"$schema": "../../schemas/v0/tests.schema.json",
33
"scenario": "Integer function",
44
"description": "The built-in formatter for integers.",
55
"defaultTestProperties": {

testdata/message2/spec/functions/number.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/unicode-org/message-format-wg/main/test/schemas/v0/tests.schema.json",
2+
"$schema": "../../schemas/v0/tests.schema.json",
33
"scenario": "Number function",
44
"description": "The built-in formatter for numbers.",
55
"defaultTestProperties": {
@@ -326,13 +326,7 @@
326326
"expParts": [
327327
{
328328
"type": "number",
329-
"source": "|42|",
330-
"parts": [
331-
{
332-
"type": "integer",
333-
"value": "42"
334-
}
335-
]
329+
"parts": [{ "type": "integer", "value": "42" }]
336330
}
337331
]
338332
}

testdata/message2/spec/functions/string.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/unicode-org/message-format-wg/main/test/schemas/v0/tests.schema.json",
2+
"$schema": "../../schemas/v0/tests.schema.json",
33
"scenario": "String function",
44
"description": "The built-in formatter for strings.",
55
"defaultTestProperties": {

0 commit comments

Comments
 (0)