Skip to content

Commit

Permalink
Add tests for operator / for string_path and basic_string
Browse files Browse the repository at this point in the history
  • Loading branch information
ashtum committed Dec 5, 2023
1 parent bf1cbc9 commit cd178de
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/test_property_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1027,14 +1027,20 @@ void test_path(PTREE *)

// Test operator /
{
path p = path(T("key1")) / T("key2.key3");
BOOST_TEST(pt.get<int>(p, 0) == 1);
path p1 = path(T("key1")) / T("key2.key3");
BOOST_TEST(pt.get<int>(p1, 0) == 1);

path p2 = path(T("key1")) / std::basic_string<CHTYPE>(T("key2.key3"));
BOOST_TEST(pt.get<int>(p2, 0) == 1);
}

// Test operator /
{
path p = T("key1.key2") / path(T("key3"));
BOOST_TEST(pt.get<int>(p, 0) == 1);
path p1 = T("key1.key2") / path(T("key3"));
BOOST_TEST(pt.get<int>(p1, 0) == 1);

path p2 = std::basic_string<CHTYPE>(T("key1.key2")) / path(T("key3"));
BOOST_TEST(pt.get<int>(p2, 0) == 1);
}

}
Expand Down

0 comments on commit cd178de

Please sign in to comment.