test(core): ingest temporal between/for/numeric-arg cases (ADR-18)
public
test(core): ingest temporal between/for/numeric-arg cases (ADR-18)
These fixtures predated full temporal support (ADR-18), so their temporal cases
were skipped by the slice detector. Regenerating each dir now keeps them:
* `0071-feel-between` — `between … and …` over date / time / date and time /
both durations (25 cases);
* `0050`-`0056` — the numeric built-ins given a temporal argument: `abs` of a
duration returns its magnitude, while `sqrt`/`exp`/`log`/`even`/`odd`/`modulo`
of a date/time/date-and-time (and `abs` of those) are type errors → null;
* `0032-feel-conditionals` — `if aDate > date(…) then … else …` over a date
input;
* `0084-feel-for-loops` — temporal iteration ranges. The datetime / time /
duration ranges yield null in both the TCK and feel-core, so they match; the
two date ranges (which the spec iterates day-by-day) are skipped via
`TEMPORAL_FOR_RANGE_SKIPS`, since feel-core iterates only integer ranges.
`cargo test -p feel-core` green on default and `--no-default-features`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| Changeset | f11e8222db6f1aa718dfcacb675d4c8b89f062ae |
|---|---|
| Author (claimed) | Timo Stolz <timo.stolz@gmail.com>, |
| Parents | 3eec2343c739 |
| Children | |
| Pushlog | by timo via ssh |
modified README.md +1 −1
| @@ -123,7 +123,7 @@ | ||
| 123 | 123 | `context put` *overloads* whose name is absent from the single-row table |
| 124 | 124 | (`date(from: …)`, `context put(…, keys: …)`; see `NAMED_ARG_OVERLOAD_SKIPS`). |
| 125 | 125 | |
| 126 | -The fixtures used by the test (70 files, ~2060 self-contained cases) are | |
| 126 | +The fixtures used by the test (70 files, ~2140 self-contained cases) are | |
| 127 | 127 | regenerated by pointing the script at each TCK dir, e.g.: |
| 128 | 128 | |
| 129 | 129 | ```sh |
modified crates/feel-core/tests/fixtures/0032-feel-conditionals.json +48 −6
| @@ -5,12 +5,12 @@ | ||
| 5 | 5 | "expected": 110.0, |
| 6 | 6 | "expected_type": "number", |
| 7 | 7 | "comparison": "f64_epsilon", |
| 8 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 8 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 9 | 9 | "context": { |
| 10 | 10 | "bool": true, |
| 11 | 11 | "num": 100.0 |
| 12 | 12 | }, |
| 13 | - "epsilon": 1e-09 | |
| 13 | + "epsilon": 1e-08 | |
| 14 | 14 | }, |
| 15 | 15 | { |
| 16 | 16 | "id": "0032-conditionals:002:simpleIf", |
| @@ -18,12 +18,12 @@ | ||
| 18 | 18 | "expected": 90.0, |
| 19 | 19 | "expected_type": "number", |
| 20 | 20 | "comparison": "f64_epsilon", |
| 21 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 21 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 22 | 22 | "context": { |
| 23 | 23 | "bool": false, |
| 24 | 24 | "num": 100.0 |
| 25 | 25 | }, |
| 26 | - "epsilon": 1e-09 | |
| 26 | + "epsilon": 1e-08 | |
| 27 | 27 | }, |
| 28 | 28 | { |
| 29 | 29 | "id": "0032-conditionals:003:simpleIf", |
| @@ -31,11 +31,53 @@ | ||
| 31 | 31 | "expected": 90.0, |
| 32 | 32 | "expected_type": "number", |
| 33 | 33 | "comparison": "f64_epsilon", |
| 34 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 34 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 35 | 35 | "context": { |
| 36 | 36 | "bool": null, |
| 37 | 37 | "num": 100.0 |
| 38 | 38 | }, |
| 39 | - "epsilon": 1e-09 | |
| 39 | + "epsilon": 1e-08 | |
| 40 | + }, | |
| 41 | + { | |
| 42 | + "id": "0032-conditionals:004:conditionWithFunctions", | |
| 43 | + "expression": "if aDate > date(\"2017-01-01\") then substring before(aString, \" \") else substring after(aString, \" \")", | |
| 44 | + "expected": "Hello", | |
| 45 | + "expected_type": "string", | |
| 46 | + "comparison": "exact", | |
| 47 | + "deviation": null, | |
| 48 | + "context": { | |
| 49 | + "aDate": { | |
| 50 | + "@type": "date", | |
| 51 | + "@value": "2017-01-02" | |
| 52 | + }, | |
| 53 | + "aString": "Hello World" | |
| 54 | + } | |
| 55 | + }, | |
| 56 | + { | |
| 57 | + "id": "0032-conditionals:005:conditionWithFunctions", | |
| 58 | + "expression": "if aDate > date(\"2017-01-01\") then substring before(aString, \" \") else substring after(aString, \" \")", | |
| 59 | + "expected": "World", | |
| 60 | + "expected_type": "string", | |
| 61 | + "comparison": "exact", | |
| 62 | + "deviation": null, | |
| 63 | + "context": { | |
| 64 | + "aDate": { | |
| 65 | + "@type": "date", | |
| 66 | + "@value": "2017-01-01" | |
| 67 | + }, | |
| 68 | + "aString": "Hello World" | |
| 69 | + } | |
| 70 | + }, | |
| 71 | + { | |
| 72 | + "id": "0032-conditionals:006:conditionWithFunctions", | |
| 73 | + "expression": "if aDate > date(\"2017-01-01\") then substring before(aString, \" \") else substring after(aString, \" \")", | |
| 74 | + "expected": "World", | |
| 75 | + "expected_type": "string", | |
| 76 | + "comparison": "exact", | |
| 77 | + "deviation": null, | |
| 78 | + "context": { | |
| 79 | + "aDate": null, | |
| 80 | + "aString": "Hello World" | |
| 81 | + } | |
| 40 | 82 | } |
| 41 | 83 | ] |
modified crates/feel-core/tests/fixtures/0050-feel-abs-function.json +62 −6
| @@ -5,8 +5,8 @@ | ||
| 5 | 5 | "expected": 1.0, |
| 6 | 6 | "expected_type": "number", |
| 7 | 7 | "comparison": "f64_epsilon", |
| 8 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 9 | - "epsilon": 1e-09 | |
| 8 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 9 | + "epsilon": 1e-08 | |
| 10 | 10 | }, |
| 11 | 11 | { |
| 12 | 12 | "id": "0050-feel-abs-function:002:decision002", |
| @@ -14,8 +14,8 @@ | ||
| 14 | 14 | "expected": 1.0, |
| 15 | 15 | "expected_type": "number", |
| 16 | 16 | "comparison": "f64_epsilon", |
| 17 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 18 | - "epsilon": 1e-09 | |
| 17 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 18 | + "epsilon": 1e-08 | |
| 19 | 19 | }, |
| 20 | 20 | { |
| 21 | 21 | "id": "0050-feel-abs-function:003:decision003", |
| @@ -23,8 +23,8 @@ | ||
| 23 | 23 | "expected": 0.0, |
| 24 | 24 | "expected_type": "number", |
| 25 | 25 | "comparison": "f64_epsilon", |
| 26 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 27 | - "epsilon": 1e-09 | |
| 26 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 27 | + "epsilon": 1e-08 | |
| 28 | 28 | }, |
| 29 | 29 | { |
| 30 | 30 | "id": "0050-feel-abs-function:004:decision004", |
| @@ -82,5 +82,61 @@ | ||
| 82 | 82 | "expected_type": "null", |
| 83 | 83 | "comparison": "exact", |
| 84 | 84 | "deviation": null |
| 85 | + }, | |
| 86 | + { | |
| 87 | + "id": "0050-feel-abs-function:011:decision011", | |
| 88 | + "expression": "abs(duration(\"-P1D\"))", | |
| 89 | + "expected": "P1D", | |
| 90 | + "expected_type": "duration", | |
| 91 | + "comparison": "exact", | |
| 92 | + "deviation": "Temporal result compared in feel-core's canonical ISO-8601 form (ADR-18). feel-core backs temporal values with jiff; at the wrappers they cross the boundary as ISO-8601 strings, so PostgreSQL can cast to date/timestamptz/interval (ADR-5's interval mapping) and WASM can return JS Date objects." | |
| 93 | + }, | |
| 94 | + { | |
| 95 | + "id": "0050-feel-abs-function:011_a:decision011_a", | |
| 96 | + "expression": "abs(duration(\"P1D\"))", | |
| 97 | + "expected": "P1D", | |
| 98 | + "expected_type": "duration", | |
| 99 | + "comparison": "exact", | |
| 100 | + "deviation": "Temporal result compared in feel-core's canonical ISO-8601 form (ADR-18). feel-core backs temporal values with jiff; at the wrappers they cross the boundary as ISO-8601 strings, so PostgreSQL can cast to date/timestamptz/interval (ADR-5's interval mapping) and WASM can return JS Date objects." | |
| 101 | + }, | |
| 102 | + { | |
| 103 | + "id": "0050-feel-abs-function:012:decision012", | |
| 104 | + "expression": "abs(duration(\"-P1Y\"))", | |
| 105 | + "expected": "P1Y", | |
| 106 | + "expected_type": "duration", | |
| 107 | + "comparison": "exact", | |
| 108 | + "deviation": "Temporal result compared in feel-core's canonical ISO-8601 form (ADR-18). feel-core backs temporal values with jiff; at the wrappers they cross the boundary as ISO-8601 strings, so PostgreSQL can cast to date/timestamptz/interval (ADR-5's interval mapping) and WASM can return JS Date objects." | |
| 109 | + }, | |
| 110 | + { | |
| 111 | + "id": "0050-feel-abs-function:012_a:decision012_a", | |
| 112 | + "expression": "abs(duration(\"P1Y\"))", | |
| 113 | + "expected": "P1Y", | |
| 114 | + "expected_type": "duration", | |
| 115 | + "comparison": "exact", | |
| 116 | + "deviation": "Temporal result compared in feel-core's canonical ISO-8601 form (ADR-18). feel-core backs temporal values with jiff; at the wrappers they cross the boundary as ISO-8601 strings, so PostgreSQL can cast to date/timestamptz/interval (ADR-5's interval mapping) and WASM can return JS Date objects." | |
| 117 | + }, | |
| 118 | + { | |
| 119 | + "id": "0050-feel-abs-function:013:decision013", | |
| 120 | + "expression": "abs(date(\"-2018-12-06\"))", | |
| 121 | + "expected": null, | |
| 122 | + "expected_type": "null", | |
| 123 | + "comparison": "exact", | |
| 124 | + "deviation": null | |
| 125 | + }, | |
| 126 | + { | |
| 127 | + "id": "0050-feel-abs-function:014:decision014", | |
| 128 | + "expression": "abs(time(\"00:00:00\"))", | |
| 129 | + "expected": null, | |
| 130 | + "expected_type": "null", | |
| 131 | + "comparison": "exact", | |
| 132 | + "deviation": null | |
| 133 | + }, | |
| 134 | + { | |
| 135 | + "id": "0050-feel-abs-function:015:decision015", | |
| 136 | + "expression": "abs(date and time(\"2018-12-06T00:00:00\"))", | |
| 137 | + "expected": null, | |
| 138 | + "expected_type": "null", | |
| 139 | + "comparison": "exact", | |
| 140 | + "deviation": null | |
| 85 | 141 | } |
| 86 | 142 | ] |
modified crates/feel-core/tests/fixtures/0051-feel-sqrt-function.json +40 −0
| @@ -81,5 +81,45 @@ | ||
| 81 | 81 | "expected_type": "null", |
| 82 | 82 | "comparison": "exact", |
| 83 | 83 | "deviation": null |
| 84 | + }, | |
| 85 | + { | |
| 86 | + "id": "0051-feel-sqrt-function:011:decision011", | |
| 87 | + "expression": "sqrt(duration(\"P4D\"))", | |
| 88 | + "expected": null, | |
| 89 | + "expected_type": "null", | |
| 90 | + "comparison": "exact", | |
| 91 | + "deviation": null | |
| 92 | + }, | |
| 93 | + { | |
| 94 | + "id": "0051-feel-sqrt-function:012:decision012", | |
| 95 | + "expression": "sqrt(duration(\"P4Y\"))", | |
| 96 | + "expected": null, | |
| 97 | + "expected_type": "null", | |
| 98 | + "comparison": "exact", | |
| 99 | + "deviation": null | |
| 100 | + }, | |
| 101 | + { | |
| 102 | + "id": "0051-feel-sqrt-function:013:decision013", | |
| 103 | + "expression": "sqrt(date(\"2018-12-06\"))", | |
| 104 | + "expected": null, | |
| 105 | + "expected_type": "null", | |
| 106 | + "comparison": "exact", | |
| 107 | + "deviation": null | |
| 108 | + }, | |
| 109 | + { | |
| 110 | + "id": "0051-feel-sqrt-function:014:decision014", | |
| 111 | + "expression": "sqrt(time(\"00:00:00\"))", | |
| 112 | + "expected": null, | |
| 113 | + "expected_type": "null", | |
| 114 | + "comparison": "exact", | |
| 115 | + "deviation": null | |
| 116 | + }, | |
| 117 | + { | |
| 118 | + "id": "0051-feel-sqrt-function:015:decision015", | |
| 119 | + "expression": "sqrt(date and time(\"2018-12-06T00:00:00\"))", | |
| 120 | + "expected": null, | |
| 121 | + "expected_type": "null", | |
| 122 | + "comparison": "exact", | |
| 123 | + "deviation": null | |
| 84 | 124 | } |
| 85 | 125 | ] |
modified crates/feel-core/tests/fixtures/0052-feel-exp-function.json +40 −0
| @@ -82,5 +82,45 @@ | ||
| 82 | 82 | "expected_type": "null", |
| 83 | 83 | "comparison": "exact", |
| 84 | 84 | "deviation": null |
| 85 | + }, | |
| 86 | + { | |
| 87 | + "id": "0052-feel-exp-function:011:decision011", | |
| 88 | + "expression": "exp(duration(\"P4D\"))", | |
| 89 | + "expected": null, | |
| 90 | + "expected_type": "null", | |
| 91 | + "comparison": "exact", | |
| 92 | + "deviation": null | |
| 93 | + }, | |
| 94 | + { | |
| 95 | + "id": "0052-feel-exp-function:012:decision012", | |
| 96 | + "expression": "exp(duration(\"P4Y\"))", | |
| 97 | + "expected": null, | |
| 98 | + "expected_type": "null", | |
| 99 | + "comparison": "exact", | |
| 100 | + "deviation": null | |
| 101 | + }, | |
| 102 | + { | |
| 103 | + "id": "0052-feel-exp-function:013:decision013", | |
| 104 | + "expression": "exp(date(\"2018-12-06\"))", | |
| 105 | + "expected": null, | |
| 106 | + "expected_type": "null", | |
| 107 | + "comparison": "exact", | |
| 108 | + "deviation": null | |
| 109 | + }, | |
| 110 | + { | |
| 111 | + "id": "0052-feel-exp-function:014:decision014", | |
| 112 | + "expression": "exp(time(\"00:00:00\"))", | |
| 113 | + "expected": null, | |
| 114 | + "expected_type": "null", | |
| 115 | + "comparison": "exact", | |
| 116 | + "deviation": null | |
| 117 | + }, | |
| 118 | + { | |
| 119 | + "id": "0052-feel-exp-function:015:decision015", | |
| 120 | + "expression": "exp(date and time(\"2018-12-06T00:00:00\"))", | |
| 121 | + "expected": null, | |
| 122 | + "expected_type": "null", | |
| 123 | + "comparison": "exact", | |
| 124 | + "deviation": null | |
| 85 | 125 | } |
| 86 | 126 | ] |
modified crates/feel-core/tests/fixtures/0053-feel-log-function.json +40 −0
| @@ -80,5 +80,45 @@ | ||
| 80 | 80 | "expected_type": "null", |
| 81 | 81 | "comparison": "exact", |
| 82 | 82 | "deviation": null |
| 83 | + }, | |
| 84 | + { | |
| 85 | + "id": "0053-feel-log-function:011:decision011", | |
| 86 | + "expression": "log(duration(\"P4D\"))", | |
| 87 | + "expected": null, | |
| 88 | + "expected_type": "null", | |
| 89 | + "comparison": "exact", | |
| 90 | + "deviation": null | |
| 91 | + }, | |
| 92 | + { | |
| 93 | + "id": "0053-feel-log-function:012:decision012", | |
| 94 | + "expression": "log(duration(\"P4Y\"))", | |
| 95 | + "expected": null, | |
| 96 | + "expected_type": "null", | |
| 97 | + "comparison": "exact", | |
| 98 | + "deviation": null | |
| 99 | + }, | |
| 100 | + { | |
| 101 | + "id": "0053-feel-log-function:013:decision013", | |
| 102 | + "expression": "log(date(\"2018-12-06\"))", | |
| 103 | + "expected": null, | |
| 104 | + "expected_type": "null", | |
| 105 | + "comparison": "exact", | |
| 106 | + "deviation": null | |
| 107 | + }, | |
| 108 | + { | |
| 109 | + "id": "0053-feel-log-function:014:decision014", | |
| 110 | + "expression": "log(time(\"00:00:00\"))", | |
| 111 | + "expected": null, | |
| 112 | + "expected_type": "null", | |
| 113 | + "comparison": "exact", | |
| 114 | + "deviation": null | |
| 115 | + }, | |
| 116 | + { | |
| 117 | + "id": "0053-feel-log-function:015:decision015", | |
| 118 | + "expression": "log(date and time(\"2018-12-06T00:00:00\"))", | |
| 119 | + "expected": null, | |
| 120 | + "expected_type": "null", | |
| 121 | + "comparison": "exact", | |
| 122 | + "deviation": null | |
| 83 | 123 | } |
| 84 | 124 | ] |
modified crates/feel-core/tests/fixtures/0054-feel-even-function.json +40 −0
| @@ -94,5 +94,45 @@ | ||
| 94 | 94 | "expected_type": "null", |
| 95 | 95 | "comparison": "exact", |
| 96 | 96 | "deviation": null |
| 97 | + }, | |
| 98 | + { | |
| 99 | + "id": "0054-feel-even-function:011:decision011", | |
| 100 | + "expression": "even(duration(\"P4D\"))", | |
| 101 | + "expected": null, | |
| 102 | + "expected_type": "null", | |
| 103 | + "comparison": "exact", | |
| 104 | + "deviation": null | |
| 105 | + }, | |
| 106 | + { | |
| 107 | + "id": "0054-feel-even-function:012:decision012", | |
| 108 | + "expression": "even(duration(\"P4Y\"))", | |
| 109 | + "expected": null, | |
| 110 | + "expected_type": "null", | |
| 111 | + "comparison": "exact", | |
| 112 | + "deviation": null | |
| 113 | + }, | |
| 114 | + { | |
| 115 | + "id": "0054-feel-even-function:013:decision013", | |
| 116 | + "expression": "even(date(\"2018-12-06\"))", | |
| 117 | + "expected": null, | |
| 118 | + "expected_type": "null", | |
| 119 | + "comparison": "exact", | |
| 120 | + "deviation": null | |
| 121 | + }, | |
| 122 | + { | |
| 123 | + "id": "0054-feel-even-function:014:decision014", | |
| 124 | + "expression": "even(time(\"00:00:00\"))", | |
| 125 | + "expected": null, | |
| 126 | + "expected_type": "null", | |
| 127 | + "comparison": "exact", | |
| 128 | + "deviation": null | |
| 129 | + }, | |
| 130 | + { | |
| 131 | + "id": "0054-feel-even-function:015:decision015", | |
| 132 | + "expression": "even(date and time(\"2018-12-06T00:00:00\"))", | |
| 133 | + "expected": null, | |
| 134 | + "expected_type": "null", | |
| 135 | + "comparison": "exact", | |
| 136 | + "deviation": null | |
| 97 | 137 | } |
| 98 | 138 | ] |
modified crates/feel-core/tests/fixtures/0055-feel-odd-function.json +40 −0
| @@ -94,5 +94,45 @@ | ||
| 94 | 94 | "expected_type": "null", |
| 95 | 95 | "comparison": "exact", |
| 96 | 96 | "deviation": null |
| 97 | + }, | |
| 98 | + { | |
| 99 | + "id": "0055-feel-odd-function:011:decision011", | |
| 100 | + "expression": "odd(duration(\"P4D\"))", | |
| 101 | + "expected": null, | |
| 102 | + "expected_type": "null", | |
| 103 | + "comparison": "exact", | |
| 104 | + "deviation": null | |
| 105 | + }, | |
| 106 | + { | |
| 107 | + "id": "0055-feel-odd-function:012:decision012", | |
| 108 | + "expression": "odd(duration(\"P4Y\"))", | |
| 109 | + "expected": null, | |
| 110 | + "expected_type": "null", | |
| 111 | + "comparison": "exact", | |
| 112 | + "deviation": null | |
| 113 | + }, | |
| 114 | + { | |
| 115 | + "id": "0055-feel-odd-function:013:decision013", | |
| 116 | + "expression": "odd(date(\"2018-12-06\"))", | |
| 117 | + "expected": null, | |
| 118 | + "expected_type": "null", | |
| 119 | + "comparison": "exact", | |
| 120 | + "deviation": null | |
| 121 | + }, | |
| 122 | + { | |
| 123 | + "id": "0055-feel-odd-function:014:decision014", | |
| 124 | + "expression": "odd(time(\"00:00:00\"))", | |
| 125 | + "expected": null, | |
| 126 | + "expected_type": "null", | |
| 127 | + "comparison": "exact", | |
| 128 | + "deviation": null | |
| 129 | + }, | |
| 130 | + { | |
| 131 | + "id": "0055-feel-odd-function:015:decision015", | |
| 132 | + "expression": "odd(date and time(\"2018-12-06T00:00:00\"))", | |
| 133 | + "expected": null, | |
| 134 | + "expected_type": "null", | |
| 135 | + "comparison": "exact", | |
| 136 | + "deviation": null | |
| 97 | 137 | } |
| 98 | 138 | ] |
modified crates/feel-core/tests/fixtures/0056-feel-modulo-function.json +64 −24
| @@ -5,8 +5,8 @@ | ||
| 5 | 5 | "expected": 2.0, |
| 6 | 6 | "expected_type": "number", |
| 7 | 7 | "comparison": "f64_epsilon", |
| 8 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 9 | - "epsilon": 1e-09 | |
| 8 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 9 | + "epsilon": 1e-08 | |
| 10 | 10 | }, |
| 11 | 11 | { |
| 12 | 12 | "id": "0056-feel-modulo-function:001_a:decision001_a", |
| @@ -14,8 +14,8 @@ | ||
| 14 | 14 | "expected": -2.0, |
| 15 | 15 | "expected_type": "number", |
| 16 | 16 | "comparison": "f64_epsilon", |
| 17 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 18 | - "epsilon": 1e-09 | |
| 17 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 18 | + "epsilon": 1e-08 | |
| 19 | 19 | }, |
| 20 | 20 | { |
| 21 | 21 | "id": "0056-feel-modulo-function:002:decision002", |
| @@ -23,8 +23,8 @@ | ||
| 23 | 23 | "expected": 2.0, |
| 24 | 24 | "expected_type": "number", |
| 25 | 25 | "comparison": "f64_epsilon", |
| 26 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 27 | - "epsilon": 1e-09 | |
| 26 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 27 | + "epsilon": 1e-08 | |
| 28 | 28 | }, |
| 29 | 29 | { |
| 30 | 30 | "id": "0056-feel-modulo-function:003:decision003", |
| @@ -32,8 +32,8 @@ | ||
| 32 | 32 | "expected": 0.0, |
| 33 | 33 | "expected_type": "number", |
| 34 | 34 | "comparison": "f64_epsilon", |
| 35 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 36 | - "epsilon": 1e-09 | |
| 35 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 36 | + "epsilon": 1e-08 | |
| 37 | 37 | }, |
| 38 | 38 | { |
| 39 | 39 | "id": "0056-feel-modulo-function:003_a:decision003_a", |
| @@ -125,13 +125,53 @@ | ||
| 125 | 125 | "deviation": null |
| 126 | 126 | }, |
| 127 | 127 | { |
| 128 | + "id": "0056-feel-modulo-function:011:decision011", | |
| 129 | + "expression": "modulo(duration(\"P10D\"), 4)", | |
| 130 | + "expected": null, | |
| 131 | + "expected_type": "null", | |
| 132 | + "comparison": "exact", | |
| 133 | + "deviation": null | |
| 134 | + }, | |
| 135 | + { | |
| 136 | + "id": "0056-feel-modulo-function:012:decision012", | |
| 137 | + "expression": "modulo(duration(\"P10Y\"), 4)", | |
| 138 | + "expected": null, | |
| 139 | + "expected_type": "null", | |
| 140 | + "comparison": "exact", | |
| 141 | + "deviation": null | |
| 142 | + }, | |
| 143 | + { | |
| 144 | + "id": "0056-feel-modulo-function:013:decision013", | |
| 145 | + "expression": "modulo(date(\"2018-12-06\"), 4)", | |
| 146 | + "expected": null, | |
| 147 | + "expected_type": "null", | |
| 148 | + "comparison": "exact", | |
| 149 | + "deviation": null | |
| 150 | + }, | |
| 151 | + { | |
| 152 | + "id": "0056-feel-modulo-function:014:decision014", | |
| 153 | + "expression": "modulo(time(\"10:00:00\"), 4)", | |
| 154 | + "expected": null, | |
| 155 | + "expected_type": "null", | |
| 156 | + "comparison": "exact", | |
| 157 | + "deviation": null | |
| 158 | + }, | |
| 159 | + { | |
| 160 | + "id": "0056-feel-modulo-function:015:decision015", | |
| 161 | + "expression": "modulo(date and time(\"2018-12-06T00:00:00\"), 4)", | |
| 162 | + "expected": null, | |
| 163 | + "expected_type": "null", | |
| 164 | + "comparison": "exact", | |
| 165 | + "deviation": null | |
| 166 | + }, | |
| 167 | + { | |
| 128 | 168 | "id": "0056-feel-modulo-function:016a:decision016a", |
| 129 | 169 | "expression": "modulo(12, 5)", |
| 130 | 170 | "expected": 2.0, |
| 131 | 171 | "expected_type": "number", |
| 132 | 172 | "comparison": "f64_epsilon", |
| 133 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 134 | - "epsilon": 1e-09 | |
| 173 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 174 | + "epsilon": 1e-08 | |
| 135 | 175 | }, |
| 136 | 176 | { |
| 137 | 177 | "id": "0056-feel-modulo-function:016b:decision016b", |
| @@ -139,8 +179,8 @@ | ||
| 139 | 179 | "expected": 3.0, |
| 140 | 180 | "expected_type": "number", |
| 141 | 181 | "comparison": "f64_epsilon", |
| 142 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 143 | - "epsilon": 1e-09 | |
| 182 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 183 | + "epsilon": 1e-08 | |
| 144 | 184 | }, |
| 145 | 185 | { |
| 146 | 186 | "id": "0056-feel-modulo-function:016c:decision016c", |
| @@ -148,8 +188,8 @@ | ||
| 148 | 188 | "expected": -3.0, |
| 149 | 189 | "expected_type": "number", |
| 150 | 190 | "comparison": "f64_epsilon", |
| 151 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 152 | - "epsilon": 1e-09 | |
| 191 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 192 | + "epsilon": 1e-08 | |
| 153 | 193 | }, |
| 154 | 194 | { |
| 155 | 195 | "id": "0056-feel-modulo-function:016d:decision016d", |
| @@ -157,8 +197,8 @@ | ||
| 157 | 197 | "expected": -2.0, |
| 158 | 198 | "expected_type": "number", |
| 159 | 199 | "comparison": "f64_epsilon", |
| 160 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 161 | - "epsilon": 1e-09 | |
| 200 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 201 | + "epsilon": 1e-08 | |
| 162 | 202 | }, |
| 163 | 203 | { |
| 164 | 204 | "id": "0056-feel-modulo-function:017a:decision017a", |
| @@ -166,8 +206,8 @@ | ||
| 166 | 206 | "expected": 1.1, |
| 167 | 207 | "expected_type": "number", |
| 168 | 208 | "comparison": "f64_epsilon", |
| 169 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 170 | - "epsilon": 1e-09 | |
| 209 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 210 | + "epsilon": 1e-08 | |
| 171 | 211 | }, |
| 172 | 212 | { |
| 173 | 213 | "id": "0056-feel-modulo-function:017b:decision017b", |
| @@ -175,8 +215,8 @@ | ||
| 175 | 215 | "expected": 3.4, |
| 176 | 216 | "expected_type": "number", |
| 177 | 217 | "comparison": "f64_epsilon", |
| 178 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 179 | - "epsilon": 1e-09 | |
| 218 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 219 | + "epsilon": 1e-08 | |
| 180 | 220 | }, |
| 181 | 221 | { |
| 182 | 222 | "id": "0056-feel-modulo-function:017c:decision017c", |
| @@ -184,8 +224,8 @@ | ||
| 184 | 224 | "expected": -3.4, |
| 185 | 225 | "expected_type": "number", |
| 186 | 226 | "comparison": "f64_epsilon", |
| 187 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 188 | - "epsilon": 1e-09 | |
| 227 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 228 | + "epsilon": 1e-08 | |
| 189 | 229 | }, |
| 190 | 230 | { |
| 191 | 231 | "id": "0056-feel-modulo-function:017d:decision017d", |
| @@ -193,7 +233,7 @@ | ||
| 193 | 233 | "expected": -1.1, |
| 194 | 234 | "expected_type": "number", |
| 195 | 235 | "comparison": "f64_epsilon", |
| 196 | - "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128; numeric results are compared with an epsilon tolerance instead of exact equality to avoid false negatives from binary floating-point rounding.", | |
| 197 | - "epsilon": 1e-09 | |
| 236 | + "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.", | |
| 237 | + "epsilon": 1e-08 | |
| 198 | 238 | } |
| 199 | 239 | ] |
modified crates/feel-core/tests/fixtures/0071-feel-between.json +200 −0
| @@ -1,4 +1,124 @@ | ||
| 1 | 1 | [ |
| 2 | + { | |
| 3 | + "id": "0071-feel-between:date_001:date_001", | |
| 4 | + "expression": "date(\"2018-12-01\") between date(\"2018-12-02\") and date(\"2018-12-04\")", | |
| 5 | + "expected": false, | |
| 6 | + "expected_type": "boolean", | |
| 7 | + "comparison": "exact", | |
| 8 | + "deviation": null | |
| 9 | + }, | |
| 10 | + { | |
| 11 | + "id": "0071-feel-between:date_002:date_002", | |
| 12 | + "expression": "date(\"2018-12-02\") between date(\"2018-12-02\") and date(\"2018-12-04\")", | |
| 13 | + "expected": true, | |
| 14 | + "expected_type": "boolean", | |
| 15 | + "comparison": "exact", | |
| 16 | + "deviation": null | |
| 17 | + }, | |
| 18 | + { | |
| 19 | + "id": "0071-feel-between:date_003:date_003", | |
| 20 | + "expression": "date(\"2018-12-03\") between date(\"2018-12-02\") and date(\"2018-12-04\")", | |
| 21 | + "expected": true, | |
| 22 | + "expected_type": "boolean", | |
| 23 | + "comparison": "exact", | |
| 24 | + "deviation": null | |
| 25 | + }, | |
| 26 | + { | |
| 27 | + "id": "0071-feel-between:date_004:date_004", | |
| 28 | + "expression": "date(\"2018-12-04\") between date(\"2018-12-02\") and date(\"2018-12-04\")", | |
| 29 | + "expected": true, | |
| 30 | + "expected_type": "boolean", | |
| 31 | + "comparison": "exact", | |
| 32 | + "deviation": null | |
| 33 | + }, | |
| 34 | + { | |
| 35 | + "id": "0071-feel-between:date_005:date_005", | |
| 36 | + "expression": "date(\"2018-12-05\") between date(\"2018-12-02\") and date(\"2018-12-04\")", | |
| 37 | + "expected": false, | |
| 38 | + "expected_type": "boolean", | |
| 39 | + "comparison": "exact", | |
| 40 | + "deviation": null | |
| 41 | + }, | |
| 42 | + { | |
| 43 | + "id": "0071-feel-between:datetime_001:datetime_001", | |
| 44 | + "expression": "date and time(\"2018-12-01T10:30:00\") between date and time(\"2018-12-02T10:30:00\") and date and time(\"2018-12-04T10:30:00\")", | |
| 45 | + "expected": false, | |
| 46 | + "expected_type": "boolean", | |
| 47 | + "comparison": "exact", | |
| 48 | + "deviation": null | |
| 49 | + }, | |
| 50 | + { | |
| 51 | + "id": "0071-feel-between:datetime_002:datetime_002", | |
| 52 | + "expression": "date and time(\"2018-12-02T10:30:00\") between date and time(\"2018-12-02T10:30:00\") and date and time(\"2018-12-04T10:30:00\")", | |
| 53 | + "expected": true, | |
| 54 | + "expected_type": "boolean", | |
| 55 | + "comparison": "exact", | |
| 56 | + "deviation": null | |
| 57 | + }, | |
| 58 | + { | |
| 59 | + "id": "0071-feel-between:datetime_003:datetime_003", | |
| 60 | + "expression": "date and time(\"2018-12-03T10:30:00\") between date and time(\"2018-12-02T10:30:00\") and date and time(\"2018-12-04T10:30:00\")", | |
| 61 | + "expected": true, | |
| 62 | + "expected_type": "boolean", | |
| 63 | + "comparison": "exact", | |
| 64 | + "deviation": null | |
| 65 | + }, | |
| 66 | + { | |
| 67 | + "id": "0071-feel-between:datetime_004:datetime_004", | |
| 68 | + "expression": "date and time(\"2018-12-04T10:30:00\") between date and time(\"2018-12-02T10:30:00\") and date and time(\"2018-12-04T10:30:00\")", | |
| 69 | + "expected": true, | |
| 70 | + "expected_type": "boolean", | |
| 71 | + "comparison": "exact", | |
| 72 | + "deviation": null | |
| 73 | + }, | |
| 74 | + { | |
| 75 | + "id": "0071-feel-between:datetime_005:datetime_005", | |
| 76 | + "expression": "date and time(\"2018-12-05T10:30:00\") between date and time(\"2018-12-02T10:30:00\") and date and time(\"2018-12-04T10:30:00\")", | |
| 77 | + "expected": false, | |
| 78 | + "expected_type": "boolean", | |
| 79 | + "comparison": "exact", | |
| 80 | + "deviation": null | |
| 81 | + }, | |
| 82 | + { | |
| 83 | + "id": "0071-feel-between:dt_duration_001:dt_duration_001", | |
| 84 | + "expression": "duration(\"P1D\") between duration(\"P2D\") and duration(\"P4D\")", | |
| 85 | + "expected": false, | |
| 86 | + "expected_type": "boolean", | |
| 87 | + "comparison": "exact", | |
| 88 | + "deviation": null | |
| 89 | + }, | |
| 90 | + { | |
| 91 | + "id": "0071-feel-between:dt_duration_002:dt_duration_002", | |
| 92 | + "expression": "duration(\"P2D\") between duration(\"P2D\") and duration(\"P4D\")", | |
| 93 | + "expected": true, | |
| 94 | + "expected_type": "boolean", | |
| 95 | + "comparison": "exact", | |
| 96 | + "deviation": null | |
| 97 | + }, | |
| 98 | + { | |
| 99 | + "id": "0071-feel-between:dt_duration_003:dt_duration_003", | |
| 100 | + "expression": "duration(\"P3D\") between duration(\"P2D\") and duration(\"P4D\")", | |
| 101 | + "expected": true, | |
| 102 | + "expected_type": "boolean", | |
| 103 | + "comparison": "exact", | |
| 104 | + "deviation": null | |
| 105 | + }, | |
| 106 | + { | |
| 107 | + "id": "0071-feel-between:dt_duration_004:dt_duration_004", | |
| 108 | + "expression": "duration(\"P4D\") between duration(\"P2D\") and duration(\"P4D\")", | |
| 109 | + "expected": true, | |
| 110 | + "expected_type": "boolean", | |
| 111 | + "comparison": "exact", | |
| 112 | + "deviation": null | |
| 113 | + }, | |
| 114 | + { | |
| 115 | + "id": "0071-feel-between:dt_duration_005:dt_duration_005", | |
| 116 | + "expression": "duration(\"P5D\") between duration(\"P2D\") and duration(\"P4D\")", | |
| 117 | + "expected": false, | |
| 118 | + "expected_type": "boolean", | |
| 119 | + "comparison": "exact", | |
| 120 | + "deviation": null | |
| 121 | + }, | |
| 2 | 122 | { |
| 3 | 123 | "id": "0071-feel-between:null_001:null_001", |
| 4 | 124 | "expression": "null between 1 and 10", |
| @@ -102,5 +222,85 @@ | ||
| 102 | 222 | "expected_type": "boolean", |
| 103 | 223 | "comparison": "exact", |
| 104 | 224 | "deviation": null |
| 225 | + }, | |
| 226 | + { | |
| 227 | + "id": "0071-feel-between:time_001:time_001", | |
| 228 | + "expression": "time(\"10:31:00\") between time(\"10:32:00\") and time(\"10:34:00\")", | |
| 229 | + "expected": false, | |
| 230 | + "expected_type": "boolean", | |
| 231 | + "comparison": "exact", | |
| 232 | + "deviation": null | |
| 233 | + }, | |
| 234 | + { | |
| 235 | + "id": "0071-feel-between:time_002:time_002", | |
| 236 | + "expression": "time(\"10:32:00\") between time(\"10:32:00\") and time(\"10:34:00\")", | |
| 237 | + "expected": true, | |
| 238 | + "expected_type": "boolean", | |
| 239 | + "comparison": "exact", | |
| 240 | + "deviation": null | |
| 241 | + }, | |
| 242 | + { | |
| 243 | + "id": "0071-feel-between:time_003:time_003", | |
| 244 | + "expression": "time(\"10:33:00\") between time(\"10:32:00\") and time(\"10:34:00\")", | |
| 245 | + "expected": true, | |
| 246 | + "expected_type": "boolean", | |
| 247 | + "comparison": "exact", | |
| 248 | + "deviation": null | |
| 249 | + }, | |
| 250 | + { | |
| 251 | + "id": "0071-feel-between:time_004:time_004", | |
| 252 | + "expression": "time(\"10:34:00\") between time(\"10:32:00\") and time(\"10:34:00\")", | |
| 253 | + "expected": true, | |
| 254 | + "expected_type": "boolean", | |
| 255 | + "comparison": "exact", | |
| 256 | + "deviation": null | |
| 257 | + }, | |
| 258 | + { | |
| 259 | + "id": "0071-feel-between:time_005:time_005", | |
| 260 | + "expression": "time(\"10:35:00\") between time(\"10:32:00\") and time(\"10:34:00\")", | |
| 261 | + "expected": false, | |
| 262 | + "expected_type": "boolean", | |
| 263 | + "comparison": "exact", | |
| 264 | + "deviation": null | |
| 265 | + }, | |
| 266 | + { | |
| 267 | + "id": "0071-feel-between:ym_duration_001:ym_duration_001", | |
| 268 | + "expression": "duration(\"P1Y\") between duration(\"P2Y\") and duration(\"P4Y\")", | |
| 269 | + "expected": false, | |
| 270 | + "expected_type": "boolean", | |
| 271 | + "comparison": "exact", | |
| 272 | + "deviation": null | |
| 273 | + }, | |
| 274 | + { | |
| 275 | + "id": "0071-feel-between:ym_duration_002:ym_duration_002", | |
| 276 | + "expression": "duration(\"P2Y\") between duration(\"P2Y\") and duration(\"P4Y\")", | |
| 277 | + "expected": true, | |
| 278 | + "expected_type": "boolean", | |
| 279 | + "comparison": "exact", | |
| 280 | + "deviation": null | |
| 281 | + }, | |
| 282 | + { | |
| 283 | + "id": "0071-feel-between:ym_duration_003:ym_duration_003", | |
| 284 | + "expression": "duration(\"P3Y\") between duration(\"P2Y\") and duration(\"P4Y\")", | |
| 285 | + "expected": true, | |
| 286 | + "expected_type": "boolean", | |
| 287 | + "comparison": "exact", | |
| 288 | + "deviation": null | |
| 289 | + }, | |
| 290 | + { | |
| 291 | + "id": "0071-feel-between:ym_duration_004:ym_duration_004", | |
| 292 | + "expression": "duration(\"P4Y\") between duration(\"P2Y\") and duration(\"P4Y\")", | |
| 293 | + "expected": true, | |
| 294 | + "expected_type": "boolean", | |
| 295 | + "comparison": "exact", | |
| 296 | + "deviation": null | |
| 297 | + }, | |
| 298 | + { | |
| 299 | + "id": "0071-feel-between:ym_duration_005:ym_duration_005", | |
| 300 | + "expression": "duration(\"P5Y\") between duration(\"P2Y\") and duration(\"P4Y\")", | |
| 301 | + "expected": false, | |
| 302 | + "expected_type": "boolean", | |
| 303 | + "comparison": "exact", | |
| 304 | + "deviation": null | |
| 105 | 305 | } |
| 106 | 306 | ] |
modified crates/feel-core/tests/fixtures/0084-feel-for-loops.json +24 −0
| @@ -113,5 +113,29 @@ | ||
| 113 | 113 | "expected_type": "null", |
| 114 | 114 | "comparison": "exact", |
| 115 | 115 | "deviation": null |
| 116 | + }, | |
| 117 | + { | |
| 118 | + "id": "0084-feel-for-loops:decision_020:decision_020", | |
| 119 | + "expression": "for i in @\"1980-01-03T00:00:00\"..@\"1980-01-01T00:00:00\" return i", | |
| 120 | + "expected": null, | |
| 121 | + "expected_type": "null", | |
| 122 | + "comparison": "exact", | |
| 123 | + "deviation": null | |
| 124 | + }, | |
| 125 | + { | |
| 126 | + "id": "0084-feel-for-loops:decision_021:decision_021", | |
| 127 | + "expression": "for i in @\"00:00:00\"..@\"00:00:00\" return i", | |
| 128 | + "expected": null, | |
| 129 | + "expected_type": "null", | |
| 130 | + "comparison": "exact", | |
| 131 | + "deviation": null | |
| 132 | + }, | |
| 133 | + { | |
| 134 | + "id": "0084-feel-for-loops:decision_022:decision_022", | |
| 135 | + "expression": "for i in @\"P1D\"..@\"P2D\" return i", | |
| 136 | + "expected": null, | |
| 137 | + "expected_type": "null", | |
| 138 | + "comparison": "exact", | |
| 139 | + "deviation": null | |
| 116 | 140 | } |
| 117 | 141 | ] |
modified tools/ingest_tck.py +19 −0
| @@ -434,6 +434,21 @@ | ||
| 434 | 434 | "1146-feel-context-put-function:nested008:nested008", |
| 435 | 435 | }) |
| 436 | 436 | |
| 437 | +# `for`/`some`/`every` iteration ranges (`a..b`) are implemented only over | |
| 438 | +# integers (README "What the slice can evaluate"; spec §10.3.2.10). A *date* range | |
| 439 | +# iterates day-by-day in the spec, so the TCK expects `for i in | |
| 440 | +# @"1980-01-01"..@"1980-01-03"` (and its descending twin) to yield the three | |
| 441 | +# dates — but feel-core builds no temporal range iterator, so it evaluates to null. | |
| 442 | +# The grammar parses the range (the `@` literals are in scope, ADR-18), so the | |
| 443 | +# slice detector keeps it; these two ascending/descending date-range cases are | |
| 444 | +# skipped here instead. The datetime / time / duration range cases in the same dir | |
| 445 | +# (`decision_020`-`022`) are *not* skipped: the TCK yields null for them too, so | |
| 446 | +# feel-core's null already matches. | |
| 447 | +TEMPORAL_FOR_RANGE_SKIPS: frozenset[str] = frozenset({ | |
| 448 | + "0084-feel-for-loops:decision_017:decision_017", | |
| 449 | + "0084-feel-for-loops:decision_018:decision_018", | |
| 450 | +}) | |
| 451 | + | |
| 437 | 452 | |
| 438 | 453 | def apply_deviations(case: Case) -> None: |
| 439 | 454 | """Run every registry rule whose predicate matches `case` (mutates in place).""" |
| @@ -664,6 +679,10 @@ | ||
| 664 | 679 | skipped.append((case_id, "named-arg overload not in feel-core's param table (ADR-23)")) |
| 665 | 680 | continue |
| 666 | 681 | |
| 682 | + if case_id in TEMPORAL_FOR_RANGE_SKIPS: | |
| 683 | + skipped.append((case_id, "date `for` range iteration not implemented (integer ranges only)")) | |
| 684 | + continue | |
| 685 | + | |
| 667 | 686 | expected, expected_type = parse_expected(result_node) |
| 668 | 687 | |
| 669 | 688 | case = Case( |