diff --git a/test/README.md b/test/README.md index b102aa14a9..662ed1bcd6 100644 --- a/test/README.md +++ b/test/README.md @@ -155,7 +155,7 @@ the behaviour of calling it as the `rv` value of MatchSelectorKeys(`rv`, `keys`) depends on its `Input`, `DecimalPlaces` and `FailsSelect` values. - If `FailsSelect` is `true`, - calling the method will emit a _Message Function Error_ + calling the method will emit a _Bad Operand_ error and not return any value. - If the `Input` is 1 and `DecimalPlaces` is 1, the method will return some slice of the list « `'1.0'`, `'1'` », @@ -185,7 +185,7 @@ rather than being concatenated into a single string. If `FailsFormat` is `true`, attempting to format the _placeholder_ to any formatting target will -emit a _Message Function Error_. +emit a _Bad Operand_ error. ### `:test:select` diff --git a/test/schemas/v0/tests.schema.json b/test/schemas/v0/tests.schema.json index cf8e821947..d0215dae33 100644 --- a/test/schemas/v0/tests.schema.json +++ b/test/schemas/v0/tests.schema.json @@ -382,10 +382,7 @@ }, "expErrors": { "description": "The runtime errors expected to be emitted when formatting the message. If expErrors is either absent or empty, the message must be formatted without errors.", - "type": [ - "array", - "boolean" - ], + "type": "array", "items": { "type": "object", "additionalProperties": false, diff --git a/test/tests/fallback.json b/test/tests/fallback.json index abf062e1c3..8c342923d7 100644 --- a/test/tests/fallback.json +++ b/test/tests/fallback.json @@ -4,52 +4,59 @@ "description": "Test cases for fallback behaviour.", "defaultTestProperties": { "bidiIsolation": "none", - "locale": "en-US", - "expErrors": true + "locale": "en-US" }, "tests": [ { "description": "function with unquoted literal operand", "src": "{42 :test:function fails=format}", "exp": "{|42|}", - "expParts": [{ "type": "fallback", "source": "|42|" }] + "expParts": [{ "type": "fallback", "source": "|42|" }], + "expErrors": [{ "type": "bad-operand" }] }, { "description": "function with quoted literal operand", "src": "{|C:\\\\| :test:function fails=format}", - "exp": "{|C:\\\\|}" + "exp": "{|C:\\\\|}", + "expErrors": [{ "type": "bad-operand" }] }, { "description": "unannotated implicit input variable", "src": "{$var}", - "exp": "{$var}" + "exp": "{$var}", + "expErrors": [{ "type": "unresolved-variable" }] }, { "description": "annotated implicit input variable", "src": "{$var :number}", "exp": "{$var}", - "expParts": [{ "type": "fallback", "source": "$var" }] + "expParts": [{ "type": "fallback", "source": "$var" }], + "expErrors": [{ "type": "unresolved-variable" }, { "type": "bad-operand" }] }, { "description": "local variable with unknown function in declaration", "src": ".local $var = {|val| :test:undefined} {{{$var}}}", - "exp": "{$var}" + "exp": "{$var}", + "expErrors": [{ "type": "unknown-function" }] }, { "description": "function with local variable operand with unknown function in declaration", "src": ".local $var = {|val| :test:undefined} {{{$var :test:function}}}", - "exp": "{$var}" + "exp": "{$var}", + "expErrors": [{ "type": "unknown-function" }, { "type": "bad-operand" }] }, { "description": "local variable with unknown function in placeholder", "src": ".local $var = {|val|} {{{$var :test:undefined}}}", - "exp": "{$var}" + "exp": "{$var}", + "expErrors": [{ "type": "unknown-function" }] }, { "description": "function with no operand", "src": "{:test:undefined}", "exp": "{:test:undefined}", - "expParts": [{ "type": "fallback", "source": ":test:undefined" }] + "expParts": [{ "type": "fallback", "source": ":test:undefined" }], + "expErrors": [{ "type": "unknown-function" }] } ] } diff --git a/test/tests/functions/currency.json b/test/tests/functions/currency.json index ea1d8aee62..593ec54863 100644 --- a/test/tests/functions/currency.json +++ b/test/tests/functions/currency.json @@ -4,7 +4,8 @@ "description": "The built-in formatter and selector for currencies.", "defaultTestProperties": { "bidiIsolation": "none", - "locale": "en-US" + "locale": "en-US", + "expErrors": [] }, "tests": [ { @@ -24,33 +25,26 @@ "expErrors": [{ "type": "bad-operand" }] }, { - "src": "{42 :currency currency=EUR}", - "expErrors": false + "src": "{42 :currency currency=EUR}" }, { - "src": ".local $n = {42 :number} {{{$n :currency currency=EUR}}}", - "expErrors": false + "src": ".local $n = {42 :number} {{{$n :currency currency=EUR}}}" }, { - "src": ".local $n = {42 :integer} {{{$n :currency currency=EUR}}}", - "expErrors": false + "src": ".local $n = {42 :integer} {{{$n :currency currency=EUR}}}" }, { - "src": ".local $n = {42 :currency currency=EUR} {{{$n :currency}}}", - "expErrors": false + "src": ".local $n = {42 :currency currency=EUR} {{{$n :currency}}}" }, { - "src": "{42 :currency currency=EUR fractionDigits=auto}", - "expErrors": false + "src": "{42 :currency currency=EUR fractionDigits=auto}" }, { - "src": "{42 :currency currency=EUR fractionDigits=2}", - "expErrors": false + "src": "{42 :currency currency=EUR fractionDigits=2}" }, { "src": "{$x :currency currency=EUR}", - "params": [{ "name": "x", "value": 41 }], - "expErrors": false + "params": [{ "name": "x", "value": 41 }] }, { "src": ".local $n = {42 :currency currency=EUR} .match $n * {{other}}", diff --git a/test/tests/functions/date.json b/test/tests/functions/date.json index c20b69a1bf..5dd1378f9d 100644 --- a/test/tests/functions/date.json +++ b/test/tests/functions/date.json @@ -5,7 +5,7 @@ "defaultTestProperties": { "bidiIsolation": "none", "locale": "en-US", - "expErrors": false + "expErrors": [] }, "tests": [ { diff --git a/test/tests/functions/datetime.json b/test/tests/functions/datetime.json index 1d45518290..d7e6cbef55 100644 --- a/test/tests/functions/datetime.json +++ b/test/tests/functions/datetime.json @@ -5,7 +5,7 @@ "defaultTestProperties": { "bidiIsolation": "none", "locale": "en-US", - "expErrors": false + "expErrors": [] }, "tests": [ { diff --git a/test/tests/functions/time.json b/test/tests/functions/time.json index 56aab3e3fb..140902bb4c 100644 --- a/test/tests/functions/time.json +++ b/test/tests/functions/time.json @@ -5,7 +5,7 @@ "defaultTestProperties": { "bidiIsolation": "none", "locale": "en-US", - "expErrors": false + "expErrors": [] }, "tests": [ {