Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions test/schemas/v0/tests.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,17 @@
"type": "string"
},
"src": {
"description": "The MF2 syntax source.",
"type": "string"
"oneOf": [
{
"description": "The source message in the MF2 format.",
"type": "string"
},
{
"description": "An array of strings to be concatenated as the source message in the MF2 format.",
"type": "array",
"items": { "type": "string" }
}
]
},
"bidiIsolation": {
"description": "The bidi isolation strategy.",
Expand Down
54 changes: 47 additions & 7 deletions test/tests/pattern-selection.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@
"exp": "1.0"
},
{
"src": ".input {$x :test:select decimalPlaces=9} .local $y = {$x :test:select decimalPlaces=1} .match $y 1.0 {{1.0}} 1 {{1}} * {{bad-option-value}}",
"src": [".input {$x :test:select decimalPlaces=9}",
".local $y = {$x :test:select decimalPlaces=1}",
".match $y 1.0",
"{{1.0}} 1",
"{{1}} * {{bad-option-value}}"],
"params": [{ "name": "x", "value": 1 }],
"exp": "bad-option-value",
"expErrors": [
Expand Down Expand Up @@ -91,28 +95,64 @@
]
},
{
"src": ".local $x = {1 :test:select} .local $y = {1 :test:select} .match $x $y 1 1 {{1,1}} 1 * {{1,*}} * 1 {{*,1}} * * {{*,*}}",
"src": [".local $x = {1 :test:select}",
".local $y = {1 :test:select}",
".match $x $y",
"1 1 {{1,1}}",
"1 * {{1,*}}",
"* 1 {{*,1}}",
"* * {{*,*}}"],
"exp": "1,1"
},
{
"src": ".local $x = {1 :test:select} .local $y = {0 :test:select} .match $x $y 1 1 {{1,1}} 1 * {{1,*}} * 1 {{*,1}} * * {{*,*}}",
"src": [".local $x = {1 :test:select}",
".local $y = {0 :test:select}",
".match $x $y",
"1 1 {{1,1}}",
"1 * {{1,*}}",
"* 1 {{*,1}}",
"* * {{*,*}}"],
"exp": "1,*"
},
{
"src": ".local $x = {0 :test:select} .local $y = {1 :test:select} .match $x $y 1 1 {{1,1}} 1 * {{1,*}} * 1 {{*,1}} * * {{*,*}}",
"src": [".local $x = {0 :test:select}",
".local $y = {1 :test:select}",
".match $x $y",
"1 1 {{1,1}}",
"1 * {{1,*}}",
"* 1 {{*,1}}",
"* * {{*,*}}"],
"exp": "*,1"
},
{
"src": ".local $x = {0 :test:select} .local $y = {0 :test:select} .match $x $y 1 1 {{1,1}} 1 * {{1,*}} * 1 {{*,1}} * * {{*,*}}",
"src": [".local $x = {0 :test:select}",
".local $y = {0 :test:select}",
".match $x $y",
"1 1 {{1,1}}",
"1 * {{1,*}}",
"* 1 {{*,1}}",
"* * {{*,*}}"],
"exp": "*,*"
},
{
"src": ".local $x = {1 :test:select fails=select} .local $y = {1 :test:select} .match $x $y 1 1 {{1,1}} 1 * {{1,*}} * 1 {{*,1}} * * {{*,*}}",
"src": [".local $x = {1 :test:select fails=select}",
".local $y = {1 :test:select}",
".match $x $y",
"1 1 {{1,1}}",
"1 * {{1,*}}",
"* 1 {{*,1}}",
"* * {{*,*}}"],
"exp": "*,1",
"expErrors": [{ "type": "bad-selector" }]
},
{
"src": ".local $x = {1 :test:select} .local $y = {1 :test:format} .match $x $y 1 1 {{1,1}} 1 * {{1,*}} * 1 {{*,1}} * * {{*,*}}",
"src": [".local $x = {1 :test:select}",
".local $y = {1 :test:format}",
".match $x $y",
"1 1 {{1,1}}",
"1 * {{1,*}}",
"* 1 {{*,1}}",
"* * {{*,*}}"],
"exp": "1,*",
"expErrors": [{ "type": "bad-selector" }]
}
Expand Down