From d493191ef4387e5187f21c44644798a0b75a283c Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 4 Nov 2024 13:02:17 -0800 Subject: [PATCH 1/7] Test schema: allow `src` property to either be a string or array of strings This makes the test schema consistent with the schema in https://github.com/unicode-org/conformance/blob/main/schema/message_fmt2/testgen_schema.json --- test/schemas/v0/tests.schema.json | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/schemas/v0/tests.schema.json b/test/schemas/v0/tests.schema.json index b6d5ac1cb..adf94ab89 100644 --- a/test/schemas/v0/tests.schema.json +++ b/test/schemas/v0/tests.schema.json @@ -175,8 +175,17 @@ "type": "string" }, "src": { - "description": "The MF2 syntax source.", - "type": "string" + "oneOf": [ + { + "description": "The MF2 syntax source.", + "type": "string" + }, + { + "description": "The MF2 syntax source, as an array of strings to be concatenated.", + "type": "array", + "items": { "type": "string" } + } + ] }, "bidiIsolation": { "description": "The bidi isolation strategy.", From f5e6be9357ba6c07ebc048e70f011f947f803bb8 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 4 Nov 2024 16:24:42 -0800 Subject: [PATCH 2/7] Update test/schemas/v0/tests.schema.json Co-authored-by: Addison Phillips --- test/schemas/v0/tests.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/schemas/v0/tests.schema.json b/test/schemas/v0/tests.schema.json index adf94ab89..23d123810 100644 --- a/test/schemas/v0/tests.schema.json +++ b/test/schemas/v0/tests.schema.json @@ -177,7 +177,7 @@ "src": { "oneOf": [ { - "description": "The MF2 syntax source.", + "description": "The source message in the MF2 format.", "type": "string" }, { From 1c72f5b8cce8421686752df9d001a3318e5580c1 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 4 Nov 2024 16:24:47 -0800 Subject: [PATCH 3/7] Update test/schemas/v0/tests.schema.json Co-authored-by: Addison Phillips --- test/schemas/v0/tests.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/schemas/v0/tests.schema.json b/test/schemas/v0/tests.schema.json index 23d123810..aa6884c13 100644 --- a/test/schemas/v0/tests.schema.json +++ b/test/schemas/v0/tests.schema.json @@ -181,7 +181,7 @@ "type": "string" }, { - "description": "The MF2 syntax source, as an array of strings to be concatenated.", + "description": "An array of strings to be concatenated as the source message in the MF2 format.", "type": "array", "items": { "type": "string" } } From 1fa63384515f295493096df07317d6c9ab8cec9d Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 11 Nov 2024 10:11:56 -0800 Subject: [PATCH 4/7] Changed longer pattern-selection tests to use arrays of src strings --- test/tests/pattern-selection.json | 54 +++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 7 deletions(-) diff --git a/test/tests/pattern-selection.json b/test/tests/pattern-selection.json index 29dc146c1..b7e6c2272 100644 --- a/test/tests/pattern-selection.json +++ b/test/tests/pattern-selection.json @@ -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}}", + "srcs": [".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": [ @@ -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" }] } From 469f0539aa11420da6dfa27a0c6f755532a2b4aa Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 11 Nov 2024 10:18:31 -0800 Subject: [PATCH 5/7] Fix syntax errors --- test/tests/pattern-selection.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/tests/pattern-selection.json b/test/tests/pattern-selection.json index b7e6c2272..722cd9641 100644 --- a/test/tests/pattern-selection.json +++ b/test/tests/pattern-selection.json @@ -58,11 +58,11 @@ "exp": "1.0" }, { - "srcs": [".input {$x :test:select decimalPlaces=9}", + "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}}", + "{{1}} * {{bad-option-value}}"], "params": [{ "name": "x", "value": 1 }], "exp": "bad-option-value", "expErrors": [ @@ -101,7 +101,7 @@ "1 1 {{1,1}}", "1 * {{1,*}}", "* 1 {{*,1}}", - "* * {{*,*}}", + "* * {{*,*}}"], "exp": "1,1" }, { @@ -111,7 +111,7 @@ "1 1 {{1,1}}", "1 * {{1,*}}", "* 1 {{*,1}}", - "* * {{*,*}}", + "* * {{*,*}}"], "exp": "1,*" }, { @@ -121,7 +121,7 @@ "1 1 {{1,1}}", "1 * {{1,*}}", "* 1 {{*,1}}", - "* * {{*,*}}", + "* * {{*,*}}"], "exp": "*,1" }, { @@ -131,7 +131,7 @@ "1 1 {{1,1}}", "1 * {{1,*}}", "* 1 {{*,1}}", - "* * {{*,*}}", + "* * {{*,*}}"], "exp": "*,*" }, { @@ -141,7 +141,7 @@ "1 1 {{1,1}}", "1 * {{1,*}}", "* 1 {{*,1}}", - "* * {{*,*}}", + "* * {{*,*}}"], "exp": "*,1", "expErrors": [{ "type": "bad-selector" }] }, @@ -152,7 +152,7 @@ "1 1 {{1,1}}", "1 * {{1,*}}", "* 1 {{*,1}}", - "* * {{*,*}}", + "* * {{*,*}}"], "exp": "1,*", "expErrors": [{ "type": "bad-selector" }] } From af2b8a4a53ae8bccef14783eb909a806b7814910 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 25 Nov 2024 12:03:52 -0800 Subject: [PATCH 6/7] Add whitespace in tests where necessary --- test/tests/pattern-selection.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/tests/pattern-selection.json b/test/tests/pattern-selection.json index 722cd9641..40c5befa8 100644 --- a/test/tests/pattern-selection.json +++ b/test/tests/pattern-selection.json @@ -59,10 +59,10 @@ }, { "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}}"], + ".local $y = {$x :test:select decimalPlaces=1}", + ".match $y\n", + "1.0 {{1.0}}\n" + "1 {{1}} * {{bad-option-value}}"], "params": [{ "name": "x", "value": 1 }], "exp": "bad-option-value", "expErrors": [ @@ -97,7 +97,7 @@ { "src": [".local $x = {1 :test:select}", ".local $y = {1 :test:select}", - ".match $x $y", + ".match $x $y\n", "1 1 {{1,1}}", "1 * {{1,*}}", "* 1 {{*,1}}", @@ -107,7 +107,7 @@ { "src": [".local $x = {1 :test:select}", ".local $y = {0 :test:select}", - ".match $x $y", + ".match $x $y\n", "1 1 {{1,1}}", "1 * {{1,*}}", "* 1 {{*,1}}", @@ -117,7 +117,7 @@ { "src": [".local $x = {0 :test:select}", ".local $y = {1 :test:select}", - ".match $x $y", + ".match $x $y\n", "1 1 {{1,1}}", "1 * {{1,*}}", "* 1 {{*,1}}", @@ -137,7 +137,7 @@ { "src": [".local $x = {1 :test:select fails=select}", ".local $y = {1 :test:select}", - ".match $x $y", + ".match $x $y\n", "1 1 {{1,1}}", "1 * {{1,*}}", "* 1 {{*,1}}", @@ -148,7 +148,7 @@ { "src": [".local $x = {1 :test:select}", ".local $y = {1 :test:format}", - ".match $x $y", + ".match $x $y\n", "1 1 {{1,1}}", "1 * {{1,*}}", "* 1 {{*,1}}", From 42e5ae772076bc939083caa7ddd8eb7352cc2a47 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 25 Nov 2024 12:05:31 -0800 Subject: [PATCH 7/7] Add missing comma --- test/tests/pattern-selection.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tests/pattern-selection.json b/test/tests/pattern-selection.json index 40c5befa8..8a81a266b 100644 --- a/test/tests/pattern-selection.json +++ b/test/tests/pattern-selection.json @@ -61,7 +61,7 @@ "src": [".input {$x :test:select decimalPlaces=9}", ".local $y = {$x :test:select decimalPlaces=1}", ".match $y\n", - "1.0 {{1.0}}\n" + "1.0 {{1.0}}\n", "1 {{1}} * {{bad-option-value}}"], "params": [{ "name": "x", "value": 1 }], "exp": "bad-option-value",