Skip to content

Commit

Permalink
Add failing tests for #5755
Browse files Browse the repository at this point in the history
  • Loading branch information
Anand Thakker committed Nov 29, 2017
1 parent 6958711 commit cb78ffe
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"propertySpec": {"type": "string"},
"expression": [
"coalesce",
["get", "a"],
5
],
"expected": {
"compiled": {
"result": "error",
"errors": [{
"key": "[2]",
"error": "Expected string but found number instead."
}]
}
}
}
28 changes: 28 additions & 0 deletions test/integration/expression-tests/coalesce/inference/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"propertySpec": {"type": "string"},
"expression": [
"coalesce",
["get", "a"],
["get", "b"]
],
"inputs": [
[{}, {"properties": {"a": "one"}}],
[{}, {"properties": {"b": "two"}}],
[{}, {"properties": {"b": 5}}],
[{}, {"properties": {}}]
],
"expected": {
"compiled": {
"isFeatureConstant": false,
"isZoomConstant": true,
"result": "success",
"type": "string"
},
"outputs": [
"one",
"two",
{"error": "Expected value to be of type string, but found number instead."},
{"error": "Expected value to be of type string, but found null instead."}
]
}
}

0 comments on commit cb78ffe

Please sign in to comment.