diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-08 22:40:36 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-08 22:40:36 +0100 |
| commit | 689b1a86d0c4cf4937492f4680457a133df368c6 (patch) | |
| tree | 1c17ec644538bbcb0fe3b54141e8833a002efff0 /test | |
| parent | 760ce54a39af82c0f4ea35f836228ce239d5a76d (diff) | |
Add the ability to find the root node name of some XML.
Diffstat (limited to 'test')
| -rw-r--r-- | test/tests.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/tests.cc b/test/tests.cc index 77f13c6..9d07e7c 100644 --- a/test/tests.cc +++ b/test/tests.cc @@ -69,10 +69,13 @@ BOOST_AUTO_TEST_CASE (test) BOOST_CHECK (!document.optional_bool_child("G")); - BOOST_CHECK_EQUAL (document.node_children("H/I").size(), 2); - BOOST_CHECK_EQUAL (document.node_children("H/I").front()->content(), "testing"); - BOOST_CHECK_EQUAL (document.node_children("H/I").back()->content(), "more testing"); + list<shared_ptr<cxml::Node> > h = document.node_children ("H"); + BOOST_CHECK_EQUAL (h.size(), 1); + BOOST_CHECK_EQUAL (h.front()->node_children("I").size(), 2); + BOOST_CHECK_EQUAL (h.front()->node_children("I").front()->content(), "testing"); + BOOST_CHECK_EQUAL (h.front()->node_children("I").back()->content(), "more testing"); - BOOST_CHECK_EQUAL (document.string_child("J/K"), "jim"); - BOOST_CHECK (!document.optional_bool_child("G")); + BOOST_CHECK_EQUAL (document.node_children("J").size(), 1); + BOOST_CHECK_EQUAL (document.node_children("J").front()->node_children("K").size(), 1); + BOOST_CHECK_EQUAL (document.node_children("J").front()->node_children("K").front()->content(), "jim"); } |
