Files
MapLibreParticleLab/metrics/integration/expression-tests/slice/invalid-inputs/test.json
Siarhei Fedartsou 09f17c0fc4 Implement slice expression (#1133)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bart Louwers <bart@emeel.net>
2023-08-26 18:32:45 +02:00

40 lines
1.4 KiB
JSON

{
"expression": ["slice", ["get", "input"], ["get", "i1"]],
"inputs": [
[{}, {"properties": {"input": false, "i1": 1}}],
[{}, {"properties": {"input": null, "i1": 1}}],
[{}, {"properties": {"input": 12, "i1": 1}}],
[{}, {"properties": {"input": {}, "i1": 1}}],
[{}, {"properties": {"other": 1, "i1": 1}}],
[{}, {"properties": {"input": "correct", "i1": "one"}}]
],
"expected": {
"serialized": ["slice", ["get", "input"], ["get", "i1"]],
"compiled": {
"result": "success",
"isFeatureConstant": false,
"isZoomConstant": true,
"type": "value"
},
"outputs": [
{
"error": "Expected first argument to be of type array or string, but found boolean instead."
},
{
"error": "Expected first argument to be of type array or string, but found null instead."
},
{
"error": "Expected first argument to be of type array or string, but found number instead."
},
{
"error": "Expected first argument to be of type array or string, but found object instead."
},
{
"error": "Expected first argument to be of type array or string, but found null instead."
},
{
"error": "Expected value to be of type number, but found string instead."
}
]
}
}