summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-10-17 15:52:11 +0200
committerKonstantin Käfer <mail@kkaefer.com>2018-10-23 12:23:40 +0200
commit43687b4781cdcd7c4e299dc625263bc3982a529f (patch)
treeacf8fe6ee82aee548402af7d8b8b6074c30f7fa1 /test
parentdecbde16165cf3e4455edd0c5caeac991d0c01e6 (diff)
downloadqtlocation-mapboxgl-43687b4781cdcd7c4e299dc625263bc3982a529f.tar.gz
[core] add ability to stringify doubles that are integer with and without trailing ".0"
Diffstat (limited to 'test')
-rw-r--r--test/util/string.test.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/util/string.test.cpp b/test/util/string.test.cpp
index 06e6ca9e9e..08e8e9f759 100644
--- a/test/util/string.test.cpp
+++ b/test/util/string.test.cpp
@@ -6,8 +6,13 @@ using namespace mbgl;
TEST(ToString, FloatingPoint) {
EXPECT_EQ("0", util::toString(0.0));
+ EXPECT_EQ("0.0", util::toString(0.0, true));
EXPECT_EQ("1.33", util::toString(1.33));
+ EXPECT_EQ("1.33", util::toString(1.33, true));
EXPECT_EQ("-1", util::toString(-1.0));
+ EXPECT_EQ("-1.0", util::toString(-1.0, true));
EXPECT_EQ("12340000000", util::toString(12340000000.0));
+ EXPECT_EQ("12340000000.0", util::toString(12340000000.0, true));
EXPECT_EQ("12340000000", util::toString(12340000000.0));
+ EXPECT_EQ("12340000000.0", util::toString(12340000000.0, true));
}