Skip to content

Commit b4fd5a6

Browse files
authored
Align test schema with error spec (#803)
1 parent b19ecf2 commit b4fd5a6

File tree

5 files changed

+24
-25
lines changed

5 files changed

+24
-25
lines changed

test/schemas/v0/tests.schema.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"$id": "https://raw.githubusercontent.com/unicode-org/message-format-wg/main/test/schemas/v0/tests.schema.json",
44
"title": "MessageFormat 2 data-driven tests",
5-
"description": "This is the main schema for MessageFormat 2 test source data.",
5+
"description": "The main schema for MessageFormat 2 test data.",
66
"type": "object",
77
"additionalProperties": false,
88
"required": [
@@ -11,7 +11,7 @@
1111
"properties": {
1212
"scenario": {
1313
"type": "string",
14-
"description": "Identifier for the tests in the file"
14+
"description": "Identifier for the tests in the file."
1515
},
1616
"description": {
1717
"type": "string",
@@ -351,12 +351,11 @@
351351
"unresolved-variable",
352352
"unknown-function",
353353
"unsupported-expression",
354-
"invalid-expression",
355-
"operand-mismatch",
356354
"unsupported-statement",
357-
"selection-error",
358-
"formatting-error",
359-
"bad-input"
355+
"bad-selector",
356+
"bad-operand",
357+
"bad-option",
358+
"bad-variant-key"
360359
]
361360
}
362361
}

test/tests/functions/date.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"exp": "{:date}",
1212
"expErrors": [
1313
{
14-
"type": "invalid-expression"
14+
"type": "bad-operand"
1515
}
1616
]
1717
},
@@ -20,7 +20,7 @@
2020
"exp": "{|horse|}",
2121
"expErrors": [
2222
{
23-
"type": "operand-mismatch"
23+
"type": "bad-operand"
2424
}
2525
]
2626
},

test/tests/functions/datetime.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"exp": "{:datetime}",
1212
"expErrors": [
1313
{
14-
"type": "invalid-expression"
14+
"type": "bad-operand"
1515
}
1616
]
1717
},
@@ -26,7 +26,7 @@
2626
],
2727
"expErrors": [
2828
{
29-
"type": "bad-input"
29+
"type": "bad-operand"
3030
}
3131
]
3232
},
@@ -35,7 +35,7 @@
3535
"exp": "{|horse|}",
3636
"expErrors": [
3737
{
38-
"type": "operand-mismatch"
38+
"type": "bad-operand"
3939
}
4040
]
4141
},

test/tests/functions/number.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"exp": "hello {|foo|}",
2323
"expErrors": [
2424
{
25-
"type": "operand-mismatch"
25+
"type": "bad-operand"
2626
}
2727
]
2828
},
@@ -31,7 +31,7 @@
3131
"exp": "invalid number literal {|.1|}",
3232
"expErrors": [
3333
{
34-
"type": "invalid-expression"
34+
"type": "bad-operand"
3535
}
3636
]
3737
},
@@ -40,7 +40,7 @@
4040
"exp": "invalid number literal {|1.|}",
4141
"expErrors": [
4242
{
43-
"type": "invalid-expression"
43+
"type": "bad-operand"
4444
}
4545
]
4646
},
@@ -49,7 +49,7 @@
4949
"exp": "invalid number literal {|01|}",
5050
"expErrors": [
5151
{
52-
"type": "invalid-expression"
52+
"type": "bad-operand"
5353
}
5454
]
5555
},
@@ -58,7 +58,7 @@
5858
"exp": "invalid number literal {|+1|}",
5959
"expErrors": [
6060
{
61-
"type": "invalid-expression"
61+
"type": "bad-operand"
6262
}
6363
]
6464
},
@@ -67,7 +67,7 @@
6767
"exp": "invalid number literal {|0x1|}",
6868
"expErrors": [
6969
{
70-
"type": "invalid-expression"
70+
"type": "bad-operand"
7171
}
7272
]
7373
},
@@ -76,7 +76,7 @@
7676
"exp": "hello {:number}",
7777
"expErrors": [
7878
{
79-
"type": "invalid-expression"
79+
"type": "bad-operand"
8080
}
8181
]
8282
},
@@ -139,7 +139,7 @@
139139
"exp": "bar {$bar}",
140140
"expErrors": [
141141
{
142-
"type": "invalid-expression"
142+
"type": "bad-option"
143143
}
144144
]
145145
},
@@ -154,7 +154,7 @@
154154
"exp": "bar {$bar}",
155155
"expErrors": [
156156
{
157-
"type": "bad-input"
157+
"type": "bad-operand"
158158
}
159159
]
160160
},
@@ -189,7 +189,7 @@
189189
"exp": "bar {$foo}",
190190
"expErrors": [
191191
{
192-
"type": "invalid-expression"
192+
"type": "bad-option"
193193
}
194194
]
195195
},
@@ -204,7 +204,7 @@
204204
"exp": "bar {$foo}",
205205
"expErrors": [
206206
{
207-
"type": "bad-input"
207+
"type": "bad-operand"
208208
}
209209
]
210210
},

test/tests/functions/time.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"exp": "{:time}",
1212
"expErrors": [
1313
{
14-
"type": "invalid-expression"
14+
"type": "bad-operand"
1515
}
1616
]
1717
},
@@ -20,7 +20,7 @@
2020
"exp": "{|horse|}",
2121
"expErrors": [
2222
{
23-
"type": "operand-mismatch"
23+
"type": "bad-operand"
2424
}
2525
]
2626
},

0 commit comments

Comments
 (0)