From decbde16165cf3e4455edd0c5caeac991d0c01e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Wed, 17 Oct 2018 15:45:35 +0200 Subject: [core] deduplicate dtoa() from RapidJSON and add tests --- test/util/string.test.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/util/string.test.cpp (limited to 'test') diff --git a/test/util/string.test.cpp b/test/util/string.test.cpp new file mode 100644 index 0000000000..06e6ca9e9e --- /dev/null +++ b/test/util/string.test.cpp @@ -0,0 +1,13 @@ +#include + +#include + +using namespace mbgl; + +TEST(ToString, FloatingPoint) { + EXPECT_EQ("0", util::toString(0.0)); + EXPECT_EQ("1.33", util::toString(1.33)); + EXPECT_EQ("-1", util::toString(-1.0)); + EXPECT_EQ("12340000000", util::toString(12340000000.0)); + EXPECT_EQ("12340000000", util::toString(12340000000.0)); +} -- cgit v1.2.1