Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-oly committed Jul 31, 2024
2 parents 47b99a1 + 1ff237c commit ecd5d84
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 57 deletions.
74 changes: 59 additions & 15 deletions schema/message_fmt2/testgen_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@
},
{
"properties": {
"tests": {
"type": "array",
"items": {
"required": [
"src"
"tests": {
"$comment": "type: array provided for clarity only",
"type": "array",
"items": {
"required": [
"src"
]
}
}
}
}
}
}
]
Expand Down Expand Up @@ -148,6 +149,9 @@
"params": {
"$ref": "#/$defs/params"
},
"comment": {
"$ref": "#/$defs/comment"
},
"exp": {
"$ref": "#/$defs/exp"
},
Expand All @@ -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."
Expand All @@ -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.",
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"exp": "{:date}",
"expErrors": [
{
"type": "invalid-expression"
"type": "bad-operand"
}
]
},
Expand All @@ -20,7 +20,7 @@
"exp": "{|horse|}",
"expErrors": [
{
"type": "operand-mismatch"
"type": "bad-operand"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"exp": "{:datetime}",
"expErrors": [
{
"type": "invalid-expression"
"type": "bad-operand"
}
]
},
Expand All @@ -26,7 +26,7 @@
],
"expErrors": [
{
"type": "bad-input"
"type": "bad-operand"
}
]
},
Expand All @@ -35,7 +35,7 @@
"exp": "{|horse|}",
"expErrors": [
{
"type": "operand-mismatch"
"type": "bad-operand"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
},
Expand All @@ -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"
}
]
},
Expand All @@ -76,7 +76,7 @@
"exp": "hello {:number}",
"expErrors": [
{
"type": "invalid-expression"
"type": "bad-operand"
}
]
},
Expand Down Expand Up @@ -139,7 +139,7 @@
"exp": "bar {$bar}",
"expErrors": [
{
"type": "invalid-expression"
"type": "bad-option"
}
]
},
Expand All @@ -154,7 +154,7 @@
"exp": "bar {$bar}",
"expErrors": [
{
"type": "bad-input"
"type": "bad-operand"
}
]
},
Expand Down Expand Up @@ -189,7 +189,7 @@
"exp": "bar {$foo}",
"expErrors": [
{
"type": "invalid-expression"
"type": "bad-option"
}
]
},
Expand All @@ -204,7 +204,7 @@
"exp": "bar {$foo}",
"expErrors": [
{
"type": "bad-input"
"type": "bad-operand"
}
]
},
Expand Down Expand Up @@ -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": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"exp": "{:time}",
"expErrors": [
{
"type": "invalid-expression"
"type": "bad-operand"
}
]
},
Expand All @@ -20,7 +20,7 @@
"exp": "{|horse|}",
"expErrors": [
{
"type": "operand-mismatch"
"type": "bad-operand"
}
]
},
Expand Down

0 comments on commit ecd5d84

Please sign in to comment.