File tree Expand file tree Collapse file tree 17 files changed +60
-81
lines changed Expand file tree Collapse file tree 17 files changed +60
-81
lines changed Original file line number Diff line number Diff line change 77 paths :
88 - test/**
99 pull_request :
10- branches : ' **'
1110 paths :
1211 - test/**
1312
2221 run : npm install --global ajv-cli
2322 - name : Validate tests using the latest schema version
2423 run : >
25- ajv validate --spec=draft2020
24+ ajv validate --spec=draft2020 --allow-union-types
2625 -s $(ls -1v schemas/*/*schema.json | tail -1)
2726 -d 'tests/**/*.json'
2827 working-directory : ./test
Original file line number Diff line number Diff line change 3939 {
4040 "properties" : {
4141 "defaultTestProperties" : {
42+ "type" : " object" ,
4243 "required" : [
4344 " locale"
4445 ]
5051 "tests" : {
5152 "type" : " array" ,
5253 "items" : {
54+ "type" : " object" ,
5355 "required" : [
5456 " locale"
5557 ]
6466 {
6567 "properties" : {
6668 "defaultTestProperties" : {
69+ "type" : " object" ,
6770 "required" : [
6871 " src"
6972 ]
7578 "tests" : {
7679 "type" : " array" ,
7780 "items" : {
81+ "type" : " object" ,
7882 "required" : [
7983 " src"
8084 ]
290294 " close"
291295 ]
292296 },
293- "source" : {
294- "type" : " string"
295- },
296297 "name" : {
297298 "type" : " string"
298299 },
308309 "description" : " Message expression part." ,
309310 "type" : " object" ,
310311 "required" : [
311- " type" ,
312- " source"
312+ " type"
313313 ],
314- "not" : {
315- "required" : [
316- " parts" ,
317- " value"
318- ]
319- },
320314 "properties" : {
321315 "type" : {
322- "type" : " string"
316+ "enum" : [
317+ " datetime" ,
318+ " number" ,
319+ " string" ,
320+ " test"
321+ ]
323322 },
324- "source " : {
323+ "locale " : {
325324 "type" : " string"
326325 },
327- "locale " : {
326+ "id " : {
328327 "type" : " string"
329328 },
330329 "parts" : {
334333 "properties" : {
335334 "type" : {
336335 "type" : " string"
337- },
338- "source" : {
339- "type" : " string"
340- },
341- "value" : {}
336+ }
342337 },
343338 "required" : [
344339 " type"
347342 },
348343 "value" : {}
349344 }
345+ },
346+ {
347+ "description" : " Fallback part." ,
348+ "type" : " object" ,
349+ "additionalProperties" : false ,
350+ "required" : [
351+ " type" ,
352+ " source"
353+ ],
354+ "properties" : {
355+ "type" : {
356+ "const" : " fallback"
357+ },
358+ "source" : {
359+ "type" : " string"
360+ }
361+ }
350362 }
351363 ]
352364 }
385397 }
386398 },
387399 "anyExp" : {
400+ "type" : " object" ,
388401 "anyOf" : [
389402 {
390403 "required" : [
Original file line number Diff line number Diff line change 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" : {
Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change 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" : {
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" ,
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" ,
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}
Original file line number Diff line number Diff line change 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" : " Currency function" ,
44 "description" : " The built-in formatter and selector for currencies." ,
55 "defaultTestProperties" : {
Original file line number Diff line number Diff line change 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" : {
Original file line number Diff line number Diff line change 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" : {
Original file line number Diff line number Diff line change 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" : {
Original file line number Diff line number Diff line change 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" : " Math function" ,
44 "description" : " The built-in formatter and selector for addition and subtraction." ,
55 "defaultTestProperties" : {
You can’t perform that action at this time.
0 commit comments