Skip to content

Commit

Permalink
Add tests for invalid mixed domain types
Browse files Browse the repository at this point in the history
Fixes #593
  • Loading branch information
jfirebaugh committed Nov 30, 2016
1 parent e2e7c95 commit d8deb0e
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 6 deletions.
44 changes: 44 additions & 0 deletions test/fixture/functions.input.json
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,50 @@
}
}
},
{
"id": "invalid mixed domain types for property function",
"type": "fill",
"source": "source",
"source-layer": "layer",
"paint": {
"fill-color": {
"property": "mapbox",
"type": "categorical",
"stops": [
[
"good",
"green"
],
[
1,
"blue"
]
]
}
}
},
{
"id": "invalid mixed domain types for zoom-and-property function",
"type": "fill",
"source": "source",
"source-layer": "layer",
"paint": {
"fill-color": {
"property": "mapbox",
"type": "categorical",
"stops": [
[
{"zoom": 0, "value": "good"},
"green"
],
[
{"zoom": 0, "value": 1},
"blue"
]
]
}
}
},
{
"id": "invalid domain type for exponential property function",
"type": "fill",
Expand Down
20 changes: 14 additions & 6 deletions test/fixture/functions.output.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,27 @@
"line": 384
},
{
"message": "layers[24].paint.fill-color.stops[0][0]: number expected, string found",
"line": 433
"message": "layers[24].paint.fill-color.stops[1][0]: number stop domain type must match previous stop domain type string",
"line": 437
},
{
"message": "layers[25].paint.fill-color.stops[0][0].value: number expected, string found",
"line": 451
"message": "layers[25].paint.fill-color.stops[1][0].value: number stop domain type must match previous stop domain type string",
"line": 459
},
{
"message": "layers[26].paint.fill-color.stops[0][0]: number expected, string found",
"line": 469
"line": 477
},
{
"message": "layers[27].paint.fill-color.stops[0][0].value: number expected, string found",
"line": 487
"line": 495
},
{
"message": "layers[28].paint.fill-color.stops[0][0]: number expected, string found",
"line": 513
},
{
"message": "layers[29].paint.fill-color.stops[0][0].value: number expected, string found",
"line": 531
}
]

0 comments on commit d8deb0e

Please sign in to comment.