Unit test showing array assignment problem on gcc 4.9
authorBarney Moss <barneym@fb.com>
Thu, 10 Dec 2015 10:37:18 +0000 (02:37 -0800)
committerfacebook-github-bot-0 <folly-bot@fb.com>
Thu, 10 Dec 2015 11:20:20 +0000 (03:20 -0800)
Summary: Unit test showing array assignment problem on gcc 4.9

Reviewed By: lbrandy

Differential Revision: D2739900

fb-gh-sync-id: 6b0fde956672b8248fbd4e620fd112195c45c646

folly/test/DynamicTest.cpp

index f9360f0..83e21cf 100644 (file)
@@ -229,6 +229,16 @@ TEST(Dynamic, DeepCopy) {
   EXPECT_EQ(obj2.at("a"), expected);
 }
 
+TEST(Dynamic, ArrayReassignment) {
+  dynamic o = 1;
+
+  dynamic d1 = {o};
+  EXPECT_EQ(dynamic::ARRAY, d1.type());
+
+  d1 = {o};
+  EXPECT_EQ(dynamic::ARRAY, d1.type());
+}
+
 TEST(Dynamic, Operator) {
   bool caught = false;
   try {