-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Anand Thakker
committed
Nov 29, 2017
1 parent
6958711
commit 06d0a62
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
test/integration/expression-tests/coalesce/argument-type-mismatch/test.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
28
test/integration/expression-tests/coalesce/inference/test.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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."} | ||
] | ||
} | ||
} |