Files
MapLibreParticleLab/metrics/integration/expression-tests/at/basic/test.json
2023-03-25 14:46:49 +01:00

31 lines
825 B
JSON

{
"expression": [
"number",
["at", ["number", ["get", "i"]], ["array", ["get", "arr"]]]
],
"inputs": [
[{}, {"properties": {"i": 1, "arr": [9, 8, 7]}}],
[{}, {"properties": {"i": -1, "arr": [9, 8, 7]}}],
[{}, {"properties": {"i": 4, "arr": [9, 8, 7]}}],
[{}, {"properties": {"i": 1.5, "arr": [9, 8, 7]}}]
],
"expected": {
"compiled": {
"result": "success",
"isFeatureConstant": false,
"isZoomConstant": true,
"type": "number"
},
"outputs": [
8,
{"error": "Array index out of bounds: -1 < 0."},
{"error": "Array index out of bounds: 4 > 2."},
{"error": "Array index must be an integer, but found 1.5 instead."}
],
"serialized": [
"number",
["at", ["number", ["get", "i"]], ["array", ["get", "arr"]]]
]
}
}