diff --git a/test/integration/load_node_test.cpp b/test/integration/load_node_test.cpp index 02bb8fe..4a78296 100644 --- a/test/integration/load_node_test.cpp +++ b/test/integration/load_node_test.cpp @@ -78,6 +78,22 @@ TEST(LoadNodeTest, IterateMap) { EXPECT_EQ(3, i); } +TEST(LoadNodeTest, AliasMultipleAssign) { + Node doc = Load("{A: &DEFAULT {str: string, int: 42, float: 3.1415}, B: *DEFAULT}"); + + for (YAML::const_iterator it = doc.begin(); it != doc.end(); ++it) { + SCOPED_TRACE("group " + it->first.as()); + Node value; + + value = it->second["str"]; + EXPECT_STREQ(value.as().c_str(), "string"); + value = it->second["float"]; + EXPECT_EQ(value.as(), 3.1415f); + value = it->second["int"]; + EXPECT_EQ(value.as(), 42); + } +} + #ifdef BOOST_FOREACH TEST(LoadNodeTest, ForEach) { Node node = Load("[1, 3, 5, 7]");