-
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.
Add render test for collator expressions.
The expression test suite is a more natural home for collator tests, but we don't have the expression test suite hooked up on Android and the collator expression has Android-specific functionality that needs testing.
- Loading branch information
Showing
2 changed files
with
223 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
223 changes: 223 additions & 0 deletions
223
test/integration/render-tests/collator/default/style.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,223 @@ | ||
{ | ||
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"height": 256, | ||
"width": 256, | ||
"description": "We use a render test for the collator expression because it has an Android-specific implementation and we don't have an Android expression test suite. For other platforms, see the collator expression tests." | ||
} | ||
}, | ||
"sources": { | ||
"mapbox": { | ||
"type": "geojson", | ||
"data": { | ||
"type": "FeatureCollection", | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"a": "a", | ||
"b": "Â", | ||
"operator": "==", | ||
"case-sensitive": false, | ||
"diacritic-sensitive": false | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
0, | ||
0 | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"a": "a", | ||
"b": "Â", | ||
"operator": "!=", | ||
"case-sensitive": false, | ||
"diacritic-sensitive": false | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
0, | ||
40 | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"a": "a", | ||
"b": "Â", | ||
"operator": "<=", | ||
"case-sensitive": true, | ||
"diacritic-sensitive": false | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
0, | ||
-40 | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"a": "a", | ||
"b": "ä", | ||
"operator": "<", | ||
"case-sensitive": true, | ||
"diacritic-sensitive": false | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
-60, | ||
40 | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"a": "a", | ||
"b": "ä", | ||
"operator": ">", | ||
"case-sensitive": true, | ||
"diacritic-sensitive": true | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
-60, | ||
0 | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"a": "a", | ||
"b": "ä", | ||
"operator": ">=", | ||
"case-sensitive": true, | ||
"diacritic-sensitive": true | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
-60, | ||
-40 | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"a": "a", | ||
"b": "ä", | ||
"operator": "<", | ||
"case-sensitive": true, | ||
"diacritic-sensitive": true | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
60, | ||
40 | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"a": "a", | ||
"b": "ä", | ||
"operator": "<", | ||
"case-sensitive": false, | ||
"diacritic-sensitive": true | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
60, | ||
0 | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"a": "a", | ||
"b": "A", | ||
"operator": "<=", | ||
"case-sensitive": true, | ||
"diacritic-sensitive": true | ||
}, | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [ | ||
60, | ||
-40 | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"glyphs": "local://glyphs/{fontstack}/{range}.pbf", | ||
"layers": [ | ||
{ | ||
"id": "background", | ||
"type": "background", | ||
"paint": { | ||
"background-color": "white" | ||
} | ||
}, | ||
{ | ||
"id": "literal", | ||
"type": "symbol", | ||
"source": "mapbox", | ||
"layout": { | ||
"text-field": ["let", | ||
"a", ["to-string", ["get", "a"]], | ||
"b", ["to-string", ["get", "b"]], | ||
"op", ["get", "operator"], | ||
"collation", ["collator", { | ||
"case-sensitive": ["get", "case-sensitive"], | ||
"diacritic-sensitive": ["get", "diacritic-sensitive"], | ||
"locale": "en" } | ||
], | ||
["concat", | ||
["var", "a"], " ", | ||
["var", "op"], " ", | ||
["var", "b"], "\n", | ||
"Case: ", ["to-string", ["get", "case-sensitive"]], "\n", | ||
"Diacritics: ", ["to-string", ["get", "diacritic-sensitive"]], "\n", | ||
["to-string", ["match", | ||
["var", "op"], | ||
"==", ["==", ["var", "a"], ["var", "b"], ["var", "collation"]], | ||
"!=", ["!=", ["var", "a"], ["var", "b"], ["var", "collation"]], | ||
"<", ["<", ["var", "a"], ["var", "b"], ["var", "collation"]], | ||
"<=", ["<=", ["var", "a"], ["var", "b"], ["var", "collation"]], | ||
">", [">", ["var", "a"], ["var", "b"], ["var", "collation"]], | ||
">=", [">=", ["var", "a"], ["var", "b"], ["var", "collation"]], | ||
false | ||
]] | ||
] | ||
], | ||
"text-font": [ | ||
"Open Sans Semibold", | ||
"Arial Unicode MS Bold" | ||
], | ||
"text-size": 10, | ||
"text-max-width": 7 | ||
} | ||
} | ||
] | ||
} |