summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJuha Alanen <juha.alanen@mapbox.com>2019-06-03 15:34:13 +0300
committerJuha Alanen <19551460+jmalanen@users.noreply.github.com>2019-06-27 15:51:22 +0300
commit0ca8ea6f169149cd414a65f40d0f7bdd40f3cca3 (patch)
treedb6a58892dd6326b8ba22da7fc822d008bdda01a /test
parent81ea5d020efd0257083bf323644a575f5ea800c9 (diff)
downloadqtlocation-mapboxgl-0ca8ea6f169149cd414a65f40d0f7bdd40f3cca3.tar.gz
[core] Add number-format expression
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/expression_equality/number-format-currency.a.json9
-rw-r--r--test/fixtures/expression_equality/number-format-currency.b.json9
-rw-r--r--test/fixtures/expression_equality/number-format-default.a.json5
-rw-r--r--test/fixtures/expression_equality/number-format-default.b.json5
-rw-r--r--test/fixtures/expression_equality/number-format-precision.a.json10
-rw-r--r--test/fixtures/expression_equality/number-format-precision.b.json10
-rw-r--r--test/style/expression/expression.test.cpp4
7 files changed, 49 insertions, 3 deletions
diff --git a/test/fixtures/expression_equality/number-format-currency.a.json b/test/fixtures/expression_equality/number-format-currency.a.json
new file mode 100644
index 0000000000..d22fb5bc4a
--- /dev/null
+++ b/test/fixtures/expression_equality/number-format-currency.a.json
@@ -0,0 +1,9 @@
+[
+ "number-format",
+ 123456.789,
+ {
+ "locale": "de-DE",
+ "currency": "EUR"
+ }
+]
+
diff --git a/test/fixtures/expression_equality/number-format-currency.b.json b/test/fixtures/expression_equality/number-format-currency.b.json
new file mode 100644
index 0000000000..c85b457142
--- /dev/null
+++ b/test/fixtures/expression_equality/number-format-currency.b.json
@@ -0,0 +1,9 @@
+[
+ "number-format",
+ 123456.789,
+ {
+ "locale": "ja-JP",
+ "currency": "JPY"
+ }
+]
+
diff --git a/test/fixtures/expression_equality/number-format-default.a.json b/test/fixtures/expression_equality/number-format-default.a.json
new file mode 100644
index 0000000000..f41348d8f8
--- /dev/null
+++ b/test/fixtures/expression_equality/number-format-default.a.json
@@ -0,0 +1,5 @@
+[
+ "number-format",
+ 123456.789, {}
+]
+
diff --git a/test/fixtures/expression_equality/number-format-default.b.json b/test/fixtures/expression_equality/number-format-default.b.json
new file mode 100644
index 0000000000..8bbc1bcfb5
--- /dev/null
+++ b/test/fixtures/expression_equality/number-format-default.b.json
@@ -0,0 +1,5 @@
+[
+ "number-format",
+ -123456.789, {}
+]
+
diff --git a/test/fixtures/expression_equality/number-format-precision.a.json b/test/fixtures/expression_equality/number-format-precision.a.json
new file mode 100644
index 0000000000..24d56d8d10
--- /dev/null
+++ b/test/fixtures/expression_equality/number-format-precision.a.json
@@ -0,0 +1,10 @@
+[
+ "number-format",
+ 987654321.23456789,
+ {
+ "locale": "en-US",
+ "min-fraction-digits": 15,
+ "max-fraction-digits": 20
+ }
+]
+
diff --git a/test/fixtures/expression_equality/number-format-precision.b.json b/test/fixtures/expression_equality/number-format-precision.b.json
new file mode 100644
index 0000000000..d8935f9f5f
--- /dev/null
+++ b/test/fixtures/expression_equality/number-format-precision.b.json
@@ -0,0 +1,10 @@
+[
+ "number-format",
+ 987654321.23456789,
+ {
+ "locale": "en-US",
+ "min-fraction-digits": 2,
+ "max-fraction-digits": 4
+ }
+]
+
diff --git a/test/style/expression/expression.test.cpp b/test/style/expression/expression.test.cpp
index 42a8fdd726..8e2acfcd32 100644
--- a/test/style/expression/expression.test.cpp
+++ b/test/style/expression/expression.test.cpp
@@ -36,10 +36,8 @@ TEST(Expression, IsExpression) {
// TODO: "feature-state": https://github.com/mapbox/mapbox-gl-native/issues/12613
// TODO: "interpolate-hcl": https://github.com/mapbox/mapbox-gl-native/issues/8720
// TODO: "interpolate-lab": https://github.com/mapbox/mapbox-gl-native/issues/8720
- // TODO: "number-format": https://github.com/mapbox/mapbox-gl-native/issues/13632
// TODO: "accumulated": https://github.com/mapbox/mapbox-gl-native/issues/14043
- if (name == "feature-state" || name == "interpolate-hcl" || name == "interpolate-lab" || name == "number-format" ||
- name == "accumulated") {
+ if (name == "feature-state" || name == "interpolate-hcl" || name == "interpolate-lab" || name == "accumulated") {
if (expression::isExpression(conversion::Convertible(expression))) {
ASSERT_TRUE(false) << "Expression name" << name << "is implemented - please update Expression.IsExpression test.";
}