From 4c0e67ae92f288be74748af9de7891b7b641943e Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Mon, 31 May 2010 16:53:13 +0000 Subject: XPath: Replaced backtracking with lookahead in absolute path parsing git-svn-id: http://pugixml.googlecode.com/svn/trunk@485 99668b35-9821-0410-8761-19e4c4f06640 --- tests/test_xpath_parse.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/test_xpath_parse.cpp') diff --git a/tests/test_xpath_parse.cpp b/tests/test_xpath_parse.cpp index b977ce5..caebb9b 100644 --- a/tests/test_xpath_parse.cpp +++ b/tests/test_xpath_parse.cpp @@ -254,4 +254,19 @@ TEST(xpath_parse_jaxen_invalid) } } +TEST_XML(xpath_parse_absolute, "
") +{ + CHECK_XPATH_NODESET(doc, STR("/")) % 1; + + CHECK_XPATH_NODESET(doc, STR("/div/s")) % 3; + CHECK_XPATH_NODESET(doc, STR("/ div /s")) % 3; + CHECK_XPATH_FAIL(STR("/ div 5")); + + CHECK_XPATH_NODESET(doc, STR("/*/s")) % 3; + CHECK_XPATH_NODESET(doc, STR("/ * /s")) % 3; + CHECK_XPATH_FAIL(STR("/ * 5")); + + CHECK_XPATH_NODESET(doc, STR("/*[/]")) % 2; +} + #endif -- cgit v1.2.3