summaryrefslogtreecommitdiff
path: root/tests/test_dom_traverse.cpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-20 20:51:20 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-20 20:51:20 +0000
commita837271e9d2eda42fb943a4189b9992b89ae9513 (patch)
tree95d7e37854e678961e12490dd3ca46e39917b6eb /tests/test_dom_traverse.cpp
parentc026597234aa371a106409271885f0cdb3c7bae3 (diff)
tests: Added wildcard and doctype tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@163 99668b35-9821-0410-8761-19e4c4f06640
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 f74a3b8..b1f83e3 100644
--- a/tests/test_dom_traverse.cpp
+++ b/tests/test_dom_traverse.cpp
@@ -724,3 +724,27 @@ TEST_XML_FLAGS(dom_offset_debug, "<?xml?><?pi?><!--comment--><node>pcdata<![CDAT
CHECK((cit++)->offset_debug() == 33);
CHECK((cit++)->offset_debug() == 48);
}
+
+TEST_XML(dom_node_wildcard_cset, "<node c='1'/>")
+{
+ xml_node node = doc.child("node");
+
+ CHECK(node.attribute_w("[A-Z]").as_int() == 0);
+ CHECK(node.attribute_w("[a-z]").as_int() == 1);
+ CHECK(node.attribute_w("[A-z]").as_int() == 1);
+ CHECK(node.attribute_w("[z-a]").as_int() == 0);
+ CHECK(node.attribute_w("[a-zA-Z]").as_int() == 1);
+ CHECK(node.attribute_w("[!A-Z]").as_int() == 1);
+ CHECK(node.attribute_w("[!A-Za-z]").as_int() == 0);
+}
+
+TEST_XML(dom_node_wildcard_star, "<node cd='1'/>")
+{
+ xml_node node = doc.child("node");
+
+ CHECK(node.attribute_w("*").as_int() == 1);
+ CHECK(node.attribute_w("?d*").as_int() == 1);
+ CHECK(node.attribute_w("?c*").as_int() == 0);
+ CHECK(node.attribute_w("*?*c*").as_int() == 0);
+ CHECK(node.attribute_w("*?*d*").as_int() == 1);
+}