projects
/
folly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7eccc5a
)
add test for numeric -> string conversions
author
Louis Brandy
<ldbrandy@fb.com>
Fri, 27 Sep 2013 17:02:51 +0000
(10:02 -0700)
committer
Peter Griess
<pgriess@fb.com>
Tue, 15 Oct 2013 01:44:04 +0000
(18:44 -0700)
Summary: We don't test this functionality (pulling a number out as a string). Almost commited a bug this would have caught.
Test Plan: Run the test.
Reviewed By: delong.j@fb.com
FB internal diff:
D987607
folly/test/DynamicTest.cpp
patch
|
blob
|
history
diff --git
a/folly/test/DynamicTest.cpp
b/folly/test/DynamicTest.cpp
index 163c6d35739df36021990206e97bba346ad32146..8cfe0b551fd9bf12c6059c9f16efd83cd783fe4e 100644
(file)
--- a/
folly/test/DynamicTest.cpp
+++ b/
folly/test/DynamicTest.cpp
@@
-216,6
+216,10
@@
TEST(Dynamic, Conversions) {
EXPECT_EQ(str.asInt(), 0);
EXPECT_EQ(str.asDouble(), 0);
EXPECT_EQ(str.asString(), "0");
+
+ dynamic num = 12;
+ EXPECT_EQ("12", num.asString());
+ EXPECT_EQ(12.0, num.asDouble());
}
TEST(Dynamic, FormattedIO) {