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

50 lines
1.1 KiB
JSON

{
"expression": {
"type": "interval",
"property": "p",
"stops": [[0, [0]], [1, [1]]]
},
"propertySpec": {
"type": "array",
"value": "number",
"length": 1,
"property-type": "data-driven",
"expression": {"interpolated": true, "parameters": ["zoom", "feature"]}
},
"inputs": [
[{}, {"properties": {}}],
[{}, {"properties": {"p": -1}}],
[{}, {"properties": {"p": 0}}],
[{}, {"properties": {"p": 0.5}}],
[{}, {"properties": {"p": 1}}],
[{}, {"properties": {"p": 2}}],
[{}, {"properties": {"p": "0"}}]
],
"expected": {
"compiled": {
"result": "success",
"isFeatureConstant": false,
"isZoomConstant": true,
"type": "array<number, 1>"
},
"outputs": [
{"error": "Expected value to be of type number, but found null instead."},
[0],
[0],
[0],
[1],
[1],
{
"error": "Expected value to be of type number, but found string instead."
}
],
"serialized": [
"step",
["number", ["get", "p"]],
["literal", [0]],
1,
["literal", [1]]
]
}
}