Skip to content

Commit

Permalink
Align test schema with error spec (#803)
Browse files Browse the repository at this point in the history
  • Loading branch information
mradbourne committed May 31, 2024
1 parent b19ecf2 commit b4fd5a6
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 25 deletions.
13 changes: 6 additions & 7 deletions test/schemas/v0/tests.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/unicode-org/message-format-wg/main/test/schemas/v0/tests.schema.json",
"title": "MessageFormat 2 data-driven tests",
"description": "This is the main schema for MessageFormat 2 test source data.",
"description": "The main schema for MessageFormat 2 test data.",
"type": "object",
"additionalProperties": false,
"required": [
Expand All @@ -11,7 +11,7 @@
"properties": {
"scenario": {
"type": "string",
"description": "Identifier for the tests in the file"
"description": "Identifier for the tests in the file."
},
"description": {
"type": "string",
Expand Down Expand Up @@ -351,12 +351,11 @@
"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"
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/tests/functions/date.json
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
6 changes: 3 additions & 3 deletions test/tests/functions/datetime.json
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
22 changes: 11 additions & 11 deletions test/tests/functions/number.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"exp": "hello {|foo|}",
"expErrors": [
{
"type": "operand-mismatch"
"type": "bad-operand"
}
]
},
Expand All @@ -31,7 +31,7 @@
"exp": "invalid number literal {|.1|}",
"expErrors": [
{
"type": "invalid-expression"
"type": "bad-operand"
}
]
},
Expand All @@ -40,7 +40,7 @@
"exp": "invalid number literal {|1.|}",
"expErrors": [
{
"type": "invalid-expression"
"type": "bad-operand"
}
]
},
Expand All @@ -49,7 +49,7 @@
"exp": "invalid number literal {|01|}",
"expErrors": [
{
"type": "invalid-expression"
"type": "bad-operand"
}
]
},
Expand All @@ -58,7 +58,7 @@
"exp": "invalid number literal {|+1|}",
"expErrors": [
{
"type": "invalid-expression"
"type": "bad-operand"
}
]
},
Expand All @@ -67,7 +67,7 @@
"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
4 changes: 2 additions & 2 deletions test/tests/functions/time.json
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 b4fd5a6

Please sign in to comment.