summaryrefslogtreecommitdiff
path: root/tests/test_dom_traverse.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-04-21 21:27:44 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-04-21 21:27:44 -0700
commitf9983ea2ed47811ad5a7e41b816642615cbd674f (patch)
treec20551f1a314ee5776680d9171388cfa5f8bd95a /tests/test_dom_traverse.cpp
parentcb786665d44598cbaff721e50d6a56b7538789e5 (diff)
parenta6cc636a6b0d531686311b5666ea77225b10903e (diff)
Merge branch 'master' into compact
Diffstat (limited to 'tests/test_dom_traverse.cpp')
-rw-r--r--tests/test_dom_traverse.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_dom_traverse.cpp b/tests/test_dom_traverse.cpp
index 4423dbe..e4b8c44 100644
--- a/tests/test_dom_traverse.cpp
+++ b/tests/test_dom_traverse.cpp
@@ -1106,3 +1106,27 @@ TEST_XML(dom_unspecified_bool_coverage, "<node attr='value'>text</node>")
static_cast<void (*)(xpath_node***)>(qn)(0);
#endif
}
+
+#if __cplusplus >= 201103
+TEST_XML(dom_ranged_for, "<node attr1='1' attr2='2'><test>3</test><fake>5</fake><test>4</test></node>")
+{
+ int index = 1;
+
+ for (xml_node n: doc.children())
+ {
+ for (xml_attribute a: n.attributes())
+ {
+ CHECK(a.as_int() == index);
+ index++;
+ }
+
+ for (xml_node c: n.children(STR("test")))
+ {
+ CHECK(c.text().as_int() == index);
+ index++;
+ }
+ }
+
+ CHECK(index == 5);
+}
+#endif