mirror of
https://github.com/zeux/pugixml.git
synced 2025-01-14 01:47:55 +08:00
tests: Added more XPath parsing tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@481 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
f1bfe4cc64
commit
2f88c5dbdf
@ -162,6 +162,15 @@ TEST(xpath_parse_paths_valid)
|
||||
STR("id(\"pet\")/SELECT[@name=\"species\"]/OPTION[@selected]/@value"), STR("descendant::INPUT[@name=\"name\"]/@value"), STR("id(\"pet\")/INPUT[@name=\"gender\" and @checked]/@value"),
|
||||
STR("//TEXTAREA[@name=\"description\"]/text()"), STR("id(\"div1\")|id(\"div2\")|id(\"div3 div4 div5\")"), STR("//LI[1]"), STR("//LI[last()]/text()"), STR("//LI[position() mod 2]/@class"),
|
||||
STR("//text()[.=\"foo\"]"), STR("descendant-or-self::SPAN[position() > 2]"), STR("descendant::*[contains(@class,\" fruit \")]"),
|
||||
|
||||
// ajaxslt considers this path invalid, however I believe it's valid as per spec
|
||||
STR("***"),
|
||||
|
||||
// Oasis MSFT considers this path invalid, however I believe it's valid as per spec
|
||||
STR("**..**"),
|
||||
|
||||
// Miscellaneous
|
||||
STR("..***..***.***.***..***..***..")
|
||||
};
|
||||
|
||||
for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); ++i)
|
||||
@ -234,6 +243,9 @@ TEST(xpath_parse_jaxen_invalid)
|
||||
|
||||
// From haXe-xpath tests
|
||||
STR("|/gjs"), STR("+3"), STR("/html/body/p != ---'div'/a"), STR(""), STR("@"), STR("#akf"), STR(",")
|
||||
|
||||
// Miscellaneous
|
||||
STR("..."), STR("...."), STR("**"), STR("****"), STR("******"), STR("..***..***.***.***..***..***..*")
|
||||
};
|
||||
|
||||
for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); ++i)
|
||||
|
Loading…
x
Reference in New Issue
Block a user