Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhamley committed Nov 20, 2019
1 parent f09360c commit c58bda2
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 31 deletions.
69 changes: 39 additions & 30 deletions test/unit/style-spec/fixture/numbers.input.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,65 +20,74 @@
"layers": [
{
"id": "valid",
"type": "symbol",
"type": "circle",
"source": "point",
"layout": {
"text-field": "hello world",
"text-max-width": 5
"paint": {
"circle-radius": 5
}
},
{
"id": "less-than-zero",
"type": "symbol",
"id": "zero",
"type": "circle",
"source": "point",
"layout": {
"text-field": "hello world",
"text-max-width": -1
"paint": {
"circle-radius": 0
}
},
{
"id": "zero",
"type": "symbol",
"id": "less-than-zero",
"type": "circle",
"source": "point",
"layout": {
"text-field": "hello world",
"text-max-width": 0
"paint": {
"circle-radius": -1
}
},
{
"id": "null-not-number",
"type": "symbol",
"type": "circle",
"source": "point",
"layout": {
"text-field": "hello world",
"text-max-width": null
"paint": {
"circle-radius": null
}
},
{
"id": "object-not-number",
"type": "symbol",
"type": "circle",
"source": "point",
"layout": {
"text-field": "hello world",
"text-max-width": {}
"paint": {
"circle-radius": {}
}
},
{
"id": "array-not-number",
"type": "symbol",
"type": "circle",
"source": "point",
"layout": {
"text-field": "hello world",
"text-max-width": []
"paint": {
"circle-radius": []
}
},
{
"id": "boolean-not-number",
"type": "symbol",
"type": "circle",
"source": "point",
"paint": {
"circle-radius": true
}
},
{
"id": "expression",
"type": "circle",
"source": "point",
"paint": {
"circle-radius": ["sqrt", 16]
}
},
{
"id": "expression-invalid",
"type": "circle",
"source": "point",
"layout": {
"text-field": "hello world",
"text-max-width": true
"paint": {
"circle-radius": ["/", 0, 0]
}
}
]
Expand Down
18 changes: 17 additions & 1 deletion test/unit/style-spec/fixture/numbers.output.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
[
{

"message": "layers[2].paint.circle-radius: -1 is less than the minimum value 0",
"line": 42
},
{
"message": "layers[3].paint.circle-radius: number expected, null found"
},
{
"message": "layers[4].paint.circle-radius: missing required property \"stops\"",
"line": 58
},
{
"message": "layers[5].paint.circle-radius: number expected, array found",
"line": 66
},
{
"message": "layers[6].paint.circle-radius: number expected, boolean found",
"line": 74
}
]

0 comments on commit c58bda2

Please sign in to comment.