Files
MapLibreParticleLab/metrics/integration/expression-tests/index-of/assert-string/test.json
2023-05-09 00:16:58 +02:00

24 lines
769 B
JSON

{
"expression": ["index-of", ["get", "substr"], ["string", ["get", "str"]]],
"inputs": [
[{}, {"properties": {"substr": null, "str": "helloworld"}}],
[{}, {"properties": {"substr": "foo", "str": "helloworld"}}],
[{}, {"properties": {"substr": "low", "str": "helloworld"}}],
[{}, {"properties": {"substr": "low", "str": null}}]
],
"expected": {
"compiled": {
"result": "success",
"isFeatureConstant": false,
"isZoomConstant": true,
"type": "number"
},
"serialized": ["index-of", ["get", "substr"], ["string", ["get", "str"]]],
"outputs": [
-1,
-1,
3,
{"error": "Expected value to be of type string, but found null instead."}
]
}
}