Unit test showing array assignment problem on gcc 4.9
[folly.git] / 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 {