Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test schema: allow src property to either be a string or array of strings #923

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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}}"],
catamorphism marked this conversation as resolved.
Show resolved Hide resolved
"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}}",
catamorphism marked this conversation as resolved.
Show resolved Hide resolved
"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