Public repository: timo / feel

Reader

An interpreter of FEEL, written in Rust, with integrations for PostgreSQL, WASM, Lua, and Python.

1
[
2
  {
3
    "id": "0012-list-functions:001:listContainsList",
4
    "expression": "list contains(list1,list2)",
5
    "expected": false,
6
    "expected_type": "boolean",
7
    "comparison": "exact",
8
    "deviation": null,
9
    "context": {
10
      "list1": [
11
        "a",
12
        "b",
13
        "c"
14
      ],
15
      "list2": [
16
        "x",
17
        "y",
18
        "z"
19
      ]
20
    }
21
  },
22
  {
23
    "id": "0012-list-functions:002:listContains",
24
    "expression": "list contains(list2,string1)",
25
    "expected": false,
26
    "expected_type": "boolean",
27
    "comparison": "exact",
28
    "deviation": null,
29
    "context": {
30
      "string1": "OK",
31
      "list2": [
32
        "x",
33
        "y",
34
        "z"
35
      ]
36
    }
37
  },
38
  {
39
    "id": "0012-list-functions:003:count1",
40
    "expression": "count(list1)",
41
    "expected": 3.0,
42
    "expected_type": "number",
43
    "comparison": "f64_epsilon",
44
    "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.",
45
    "context": {
46
      "list1": [
47
        "a",
48
        "b",
49
        "c"
50
      ]
51
    },
52
    "epsilon": 1e-08
53
  },
54
  {
55
    "id": "0012-list-functions:004:min1",
56
    "expression": "min(numList)",
57
    "expected": -3.0,
58
    "expected_type": "number",
59
    "comparison": "f64_epsilon",
60
    "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.",
61
    "context": {
62
      "numList": [
63
        6.0,
64
        14.0,
65
        -3.0
66
      ]
67
    },
68
    "epsilon": 1e-08
69
  },
70
  {
71
    "id": "0012-list-functions:005:sum1",
72
    "expression": "sum(numList)",
73
    "expected": 17.0,
74
    "expected_type": "number",
75
    "comparison": "f64_epsilon",
76
    "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.",
77
    "context": {
78
      "numList": [
79
        6.0,
80
        14.0,
81
        -3.0
82
      ]
83
    },
84
    "epsilon": 1e-08
85
  },
86
  {
87
    "id": "0012-list-functions:006:mean1",
88
    "expression": "mean(numList)",
89
    "expected": 5.66666666666667,
90
    "expected_type": "number",
91
    "comparison": "f64_epsilon",
92
    "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.",
93
    "context": {
94
      "numList": [
95
        6.0,
96
        14.0,
97
        -3.0
98
      ]
99
    },
100
    "epsilon": 1e-08
101
  },
102
  {
103
    "id": "0012-list-functions:007:mean2",
104
    "expression": "mean(num1,num2,num3)",
105
    "expected": 7.66666666666667,
106
    "expected_type": "number",
107
    "comparison": "f64_epsilon",
108
    "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.",
109
    "context": {
110
      "num1": 11.0,
111
      "num2": 2.0,
112
      "num3": 10.0
113
    },
114
    "epsilon": 1e-08
115
  },
116
  {
117
    "id": "0012-list-functions:008:sublist12",
118
    "expression": "sublist(list1,1,2)",
119
    "expected": [
120
      "a",
121
      "b"
122
    ],
123
    "expected_type": "list",
124
    "comparison": "exact",
125
    "deviation": null,
126
    "context": {
127
      "list1": [
128
        "a",
129
        "b",
130
        "c"
131
      ]
132
    }
133
  },
134
  {
135
    "id": "0012-list-functions:009:sublistLast",
136
    "expression": "sublist(list1,-1,1)",
137
    "expected": [
138
      "c"
139
    ],
140
    "expected_type": "list",
141
    "comparison": "exact",
142
    "deviation": null,
143
    "context": {
144
      "list1": [
145
        "a",
146
        "b",
147
        "c"
148
      ]
149
    }
150
  },
151
  {
152
    "id": "0012-list-functions:010:append1",
153
    "expression": "append(numList,num1,num2)",
154
    "expected": [
155
      6.0,
156
      14.0,
157
      -3.0,
158
      11.0,
159
      2.0
160
    ],
161
    "expected_type": "list",
162
    "comparison": "exact",
163
    "deviation": null,
164
    "context": {
165
      "num1": 11.0,
166
      "num2": 2.0,
167
      "num3": 10.0,
168
      "numList": [
169
        6.0,
170
        14.0,
171
        -3.0
172
      ]
173
    }
174
  },
175
  {
176
    "id": "0012-list-functions:011:concatenate1",
177
    "expression": "concatenate(list1,list2)",
178
    "expected": [
179
      "a",
180
      "b",
181
      "c",
182
      "x",
183
      "y",
184
      "z"
185
    ],
186
    "expected_type": "list",
187
    "comparison": "exact",
188
    "deviation": null,
189
    "context": {
190
      "list1": [
191
        "a",
192
        "b",
193
        "c"
194
      ],
195
      "list2": [
196
        "x",
197
        "y",
198
        "z"
199
      ]
200
    }
201
  },
202
  {
203
    "id": "0012-list-functions:012:insertBefore1",
204
    "expression": "insert before(list2,2,string1)",
205
    "expected": [
206
      "x",
207
      "OK",
208
      "y",
209
      "z"
210
    ],
211
    "expected_type": "list",
212
    "comparison": "exact",
213
    "deviation": null,
214
    "context": {
215
      "string1": "OK",
216
      "list2": [
217
        "x",
218
        "y",
219
        "z"
220
      ]
221
    }
222
  },
223
  {
224
    "id": "0012-list-functions:013:remove2nd",
225
    "expression": "remove(list2,2)",
226
    "expected": [
227
      "x",
228
      "z"
229
    ],
230
    "expected_type": "list",
231
    "comparison": "exact",
232
    "deviation": null,
233
    "context": {
234
      "list2": [
235
        "x",
236
        "y",
237
        "z"
238
      ]
239
    }
240
  },
241
  {
242
    "id": "0012-list-functions:015:appendListItem",
243
    "expression": "append(list1,string1)",
244
    "expected": [
245
      "a",
246
      "b",
247
      "c",
248
      "x"
249
    ],
250
    "expected_type": "list",
251
    "comparison": "exact",
252
    "deviation": null,
253
    "context": {
254
      "list1": [
255
        "a",
256
        "b",
257
        "c"
258
      ],
259
      "string1": "x"
260
    }
261
  },
262
  {
263
    "id": "0012-list-functions:016:indexOf1",
264
    "expression": "index of(list2,string1)",
265
    "expected": [],
266
    "expected_type": "list",
267
    "comparison": "exact",
268
    "deviation": null,
269
    "context": {
270
      "string1": "OK",
271
      "list2": [
272
        "x",
273
        "y",
274
        "z"
275
      ]
276
    }
277
  },
278
  {
279
    "id": "0012-list-functions:019:flatten1",
280
    "expression": "flatten(append(list1, list2))",
281
    "expected": [
282
      "a",
283
      "b",
284
      "c",
285
      "x",
286
      "y",
287
      "z"
288
    ],
289
    "expected_type": "list",
290
    "comparison": "exact",
291
    "deviation": null,
292
    "context": {
293
      "list1": [
294
        "a",
295
        "b",
296
        "c"
297
      ],
298
      "list2": [
299
        "x",
300
        "y",
301
        "z"
302
      ]
303
    }
304
  }
305
]