diff --git a/schema/message_fmt2/testgen_schema.json b/schema/message_fmt2/testgen_schema.json index e3f9e6e4..a329bd34 100644 --- a/schema/message_fmt2/testgen_schema.json +++ b/schema/message_fmt2/testgen_schema.json @@ -68,14 +68,15 @@ }, { "properties": { - "tests": { - "type": "array", - "items": { - "required": [ - "src" + "tests": { + "$comment": "type: array provided for clarity only", + "type": "array", + "items": { + "required": [ + "src" ] - } - } + } + } } } ] @@ -148,6 +149,9 @@ "params": { "$ref": "#/$defs/params" }, + "comment": { + "$ref": "#/$defs/comment" + }, "exp": { "$ref": "#/$defs/exp" }, @@ -160,6 +164,18 @@ "expErrors": { "$ref": "#/$defs/expErrors" }, + "ignoreCpp": { + "$ref": "#/$defs/ignoreCpp" + }, + "ignoreJava": { + "$ref": "#/$defs/ignoreJava" + }, + "char": { + "$ref": "#/$defs/char" + }, + "line": { + "$ref": "#/$defs/line" + }, "only": { "type": "boolean", "description": "Normally not set. A flag to use during development to only run one or more specific tests." @@ -171,8 +187,17 @@ "type": "string" }, "src": { - "description": "The MF2 syntax source.", - "type": "string" + "oneOf": [ + { + "description": "The MF2 syntax source.", + "type": "string" + }, + { + "description": "The MF2 syntax source, as an array of strings to be concatenated.", + "type": "array", + "items": { "type": "string" } + } + ] }, "params": { "description": "Parameters to pass in to the formatter for resolving external variables.", @@ -219,6 +244,10 @@ } ] }, + "comment": { + "description": "A human-readable comment, meant to be ignored by the test runner", + "type": "string" + }, "exp": { "description": "The expected result of formatting the message to a string.", "type": "string" @@ -351,17 +380,32 @@ "unresolved-variable", "unknown-function", "unsupported-expression", - "invalid-expression", - "operand-mismatch", - "unsupported-statement", - "selection-error", - "formatting-error", - "bad-input" + "bad-selector", + "bad-operand", + "bad-option", + "bad-variant-key", + "unsupported-statement" ] } } } }, + "ignoreCpp": { + "description": "If present, ignore this test when testing ICU4C. The string is an explanation of why the test doesn't pass.", + "type": "string" + }, + "ignoreJava": { + "description": "If present, ignore this test when testing ICU4J. The string is an explanation of why the test doesn't pass.", + "type": "string" + }, + "char": { + "description": "Optional character offset that should appear in syntax error. Only used by ICU4C currently", + "type": "number" + }, + "line": { + "description": "Optional line number that should appear in syntax error. Only used by ICU4C currently", + "type": "number" + }, "anyExp": { "anyOf": [ { diff --git a/testgen/icu75/message_fmt2/message-format-wg-tests/functions/date.json b/testgen/icu75/message_fmt2/message-format-wg-tests/functions/date.json index 472b46d8..8252ab8b 100644 --- a/testgen/icu75/message_fmt2/message-format-wg-tests/functions/date.json +++ b/testgen/icu75/message_fmt2/message-format-wg-tests/functions/date.json @@ -11,7 +11,7 @@ "exp": "{:date}", "expErrors": [ { - "type": "invalid-expression" + "type": "bad-operand" } ] }, @@ -20,7 +20,7 @@ "exp": "{|horse|}", "expErrors": [ { - "type": "operand-mismatch" + "type": "bad-operand" } ] }, diff --git a/testgen/icu75/message_fmt2/message-format-wg-tests/functions/datetime.json b/testgen/icu75/message_fmt2/message-format-wg-tests/functions/datetime.json index 18e0cd97..677a3853 100644 --- a/testgen/icu75/message_fmt2/message-format-wg-tests/functions/datetime.json +++ b/testgen/icu75/message_fmt2/message-format-wg-tests/functions/datetime.json @@ -11,7 +11,7 @@ "exp": "{:datetime}", "expErrors": [ { - "type": "invalid-expression" + "type": "bad-operand" } ] }, @@ -26,7 +26,7 @@ ], "expErrors": [ { - "type": "bad-input" + "type": "bad-operand" } ] }, @@ -35,7 +35,7 @@ "exp": "{|horse|}", "expErrors": [ { - "type": "operand-mismatch" + "type": "bad-operand" } ] }, diff --git a/testgen/icu75/message_fmt2/message-format-wg-tests/functions/number.json b/testgen/icu75/message_fmt2/message-format-wg-tests/functions/number.json index 515600c4..dc552d32 100644 --- a/testgen/icu75/message_fmt2/message-format-wg-tests/functions/number.json +++ b/testgen/icu75/message_fmt2/message-format-wg-tests/functions/number.json @@ -22,34 +22,34 @@ "exp": "hello {|foo|}", "expErrors": [ { - "type": "operand-mismatch" + "type": "bad-operand" } ] }, { - "src": "invalid number literal {.1 :number}", + "src": "invalid number literal {|.1| :number}", "exp": "invalid number literal {|.1|}", "expErrors": [ { - "type": "invalid-expression" + "type": "bad-operand" } ] }, { - "src": "invalid number literal {1. :number}", + "src": "invalid number literal {|1.| :number}", "exp": "invalid number literal {|1.|}", "expErrors": [ { - "type": "invalid-expression" + "type": "bad-operand" } ] }, { - "src": "invalid number literal {01 :number}", + "src": "invalid number literal {|01| :number}", "exp": "invalid number literal {|01|}", "expErrors": [ { - "type": "invalid-expression" + "type": "bad-operand" } ] }, @@ -58,16 +58,16 @@ "exp": "invalid number literal {|+1|}", "expErrors": [ { - "type": "invalid-expression" + "type": "bad-operand" } ] }, { - "src": "invalid number literal {0x1 :number}", + "src": "invalid number literal {|0x1| :number}", "exp": "invalid number literal {|0x1|}", "expErrors": [ { - "type": "invalid-expression" + "type": "bad-operand" } ] }, @@ -76,7 +76,7 @@ "exp": "hello {:number}", "expErrors": [ { - "type": "invalid-expression" + "type": "bad-operand" } ] }, @@ -139,7 +139,7 @@ "exp": "bar {$bar}", "expErrors": [ { - "type": "invalid-expression" + "type": "bad-option" } ] }, @@ -154,7 +154,7 @@ "exp": "bar {$bar}", "expErrors": [ { - "type": "bad-input" + "type": "bad-operand" } ] }, @@ -189,7 +189,7 @@ "exp": "bar {$foo}", "expErrors": [ { - "type": "invalid-expression" + "type": "bad-option" } ] }, @@ -204,7 +204,7 @@ "exp": "bar {$foo}", "expErrors": [ { - "type": "bad-input" + "type": "bad-operand" } ] }, @@ -340,26 +340,6 @@ ], "exp": "other" }, - { - "src": ".input {$bar} .match {$bar :number} one {{one}} * {{other}}", - "params": [ - { - "name": "bar", - "value": 1 - } - ], - "exp": "one" - }, - { - "src": ".input {$bar} .match {$bar :number} one {{one}} * {{other}}", - "params": [ - { - "name": "bar", - "value": 2 - } - ], - "exp": "other" - }, { "src": ".input {$none} .match {$foo :number} one {{one}} * {{{$none}}}", "params": [ diff --git a/testgen/icu75/message_fmt2/message-format-wg-tests/functions/time.json b/testgen/icu75/message_fmt2/message-format-wg-tests/functions/time.json index 4c5dd22b..201f8fad 100644 --- a/testgen/icu75/message_fmt2/message-format-wg-tests/functions/time.json +++ b/testgen/icu75/message_fmt2/message-format-wg-tests/functions/time.json @@ -11,7 +11,7 @@ "exp": "{:time}", "expErrors": [ { - "type": "invalid-expression" + "type": "bad-operand" } ] }, @@ -20,7 +20,7 @@ "exp": "{|horse|}", "expErrors": [ { - "type": "operand-mismatch" + "type": "bad-operand" } ] },