diff options
author | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2010-08-04 14:15:46 +0000 |
---|---|---|
committer | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2010-08-04 14:15:46 +0000 |
commit | deb9e8bc74e67ec14a39dd977afbfe345d5586f6 (patch) | |
tree | 674cc4fc5a9efb332b6728d256bb42fa0666ac50 /tests/test_xpath_api.cpp | |
parent | 6df3609007d59dfa5f6cc218902da49ff258befc (diff) |
tests: Added more XPath tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@628 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/test_xpath_api.cpp')
-rw-r--r-- | tests/test_xpath_api.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_xpath_api.cpp b/tests/test_xpath_api.cpp index bf35b62..ad05083 100644 --- a/tests/test_xpath_api.cpp +++ b/tests/test_xpath_api.cpp @@ -114,6 +114,32 @@ TEST_XML(xpath_api_nodeset_accessors, "<node><foo/><foo/></node>") xpath_node_set nullcopy = null; } +TEST_XML(xpath_api_nodeset_copy, "<node><foo/><foo/></node>") +{ + xpath_node_set set = doc.select_nodes(STR("node/foo")); + + xpath_node_set copy1 = set; + CHECK(copy1.size() == 2); + CHECK_STRING(copy1[0].node().name(), STR("foo")); + + xpath_node_set copy2; + copy2 = set; + CHECK(copy2.size() == 2); + CHECK_STRING(copy2[0].node().name(), STR("foo")); + + xpath_node_set copy3; + copy3 = set; + copy3 = copy3; + CHECK(copy3.size() == 2); + CHECK_STRING(copy3[0].node().name(), STR("foo")); + + xpath_node_set copy4; + copy4 = set; + copy4 = copy1; + CHECK(copy4.size() == 2); + CHECK_STRING(copy4[0].node().name(), STR("foo")); +} + TEST_XML(xpath_api_evaluate, "<node attr='3'/>") { xpath_query q(STR("node/@attr")); |