diff --git a/xml_converter/tests/test_string_hierarchy.cpp b/xml_converter/tests/test_string_hierarchy.cpp index c4c6243e..7eed8a30 100644 --- a/xml_converter/tests/test_string_hierarchy.cpp +++ b/xml_converter/tests/test_string_hierarchy.cpp @@ -42,6 +42,8 @@ TEST_F(StringHierarchyTest, NonExistantDepthNode) { TEST_F(StringHierarchyTest, AllExistDepthNode) { string_hierarchy.add_path({"root", "child1", "child2"}, true); EXPECT_TRUE(string_hierarchy.in_hierarchy({"root", "child1", "child2", "child3"})); + EXPECT_TRUE(string_hierarchy.in_hierarchy({"root", "child1", "child2"})); + EXPECT_FALSE(string_hierarchy.in_hierarchy({"root", "child1", "child2b"})); } TEST_F(StringHierarchyTest, DoubleNode) { @@ -60,6 +62,11 @@ TEST_F(StringHierarchyTest, OverwriteAllChildrenRoot) { EXPECT_TRUE(string_hierarchy.in_hierarchy({"root", "somethingrandom"})); } +TEST_F(StringHierarchyTest, AllowAll) { + string_hierarchy.add_path({}, true); + EXPECT_TRUE(string_hierarchy.in_hierarchy({"literally", "anything"})); +} + int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS();