Commit 442a46c3 authored by Louis Brandy's avatar Louis Brandy Committed by Peter Griess

add test for numeric -> string conversions

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
parent 7eccc5a3
...@@ -216,6 +216,10 @@ TEST(Dynamic, Conversions) { ...@@ -216,6 +216,10 @@ TEST(Dynamic, Conversions) {
EXPECT_EQ(str.asInt(), 0); EXPECT_EQ(str.asInt(), 0);
EXPECT_EQ(str.asDouble(), 0); EXPECT_EQ(str.asDouble(), 0);
EXPECT_EQ(str.asString(), "0"); EXPECT_EQ(str.asString(), "0");
dynamic num = 12;
EXPECT_EQ("12", num.asString());
EXPECT_EQ(12.0, num.asDouble());
} }
TEST(Dynamic, FormattedIO) { TEST(Dynamic, FormattedIO) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment