summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-09-26 00:44:50 +0100
committerCarl Hetherington <cth@carlh.net>2013-09-26 00:44:50 +0100
commitc534aeb70d3770b5a081796b7aae1cfef1411cad (patch)
tree045a84e91f5dc820019f8905d3fc338e983d0fc7
parent3b6ddf4b140befd1286af26c34800a50b3ba3f56 (diff)
More tests.
-rw-r--r--test/ref/a.xml2
-rw-r--r--test/tests.cc9
2 files changed, 10 insertions, 1 deletions
diff --git a/test/ref/a.xml b/test/ref/a.xml
index 0a37114..e854aae 100644
--- a/test/ref/a.xml
+++ b/test/ref/a.xml
@@ -5,4 +5,6 @@
<E>yes</E>
<F>1</F>
<F>2</F>
+ <H><I>testing</I><I>more testing</I></H>
+ <J><K>jim</K></J>
</A>
diff --git a/test/tests.cc b/test/tests.cc
index ed8d2f4..90b31cb 100644
--- a/test/tests.cc
+++ b/test/tests.cc
@@ -61,9 +61,16 @@ BOOST_AUTO_TEST_CASE (test)
BOOST_CHECK (document.optional_bool_child("E"));
BOOST_CHECK_EQUAL (document.optional_bool_child("E").get(), true);
BOOST_CHECK_THROW (document.optional_bool_child("F"), cxml::Error);
- BOOST_CHECK (!document.optional_bool_child("G"));
BOOST_CHECK_EQUAL (document.node_children("F").size(), 2);
BOOST_CHECK_EQUAL (document.node_children("F").front()->content(), "1");
BOOST_CHECK_EQUAL (document.node_children("F").back()->content(), "2");
+
+ 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");
+
+ BOOST_CHECK_EQUAL (document.string_child("J/K"), "jim");
}