Skip to content
Snippets Groups Projects
Commit cac1d8ad authored by Arseny Kapoulkine's avatar Arseny Kapoulkine
Browse files

tests: Add an error propagation test for XPath

This test is supposed to test error coverage in different expressions
that are nested in other expressions to reduce the number of never-taken
branches in tests (and make sure we aren't missing any).
parent 1b3e8614
No related branches found
No related tags found
No related merge requests found
......@@ -313,4 +313,26 @@ TEST(xpath_parse_result_default)
CHECK(result.offset == 0);
}
TEST(xpath_parse_error_propagation)
{
char_t query[] = STR("(//foo[count(. | @*)] | /foo | /foo/bar//more/ancestor-or-self::foobar | /text() | a[1 + 2 * 3 div (1+0) mod 2]//b[1]/c | a[$x])[true()]");
xpath_variable_set vars;
vars.set(STR("x"), 1.0);
xpath_query q(query, &vars);
CHECK(q);
for (size_t i = 0; i + 1 < sizeof(query) / sizeof(query[0]); ++i)
{
char_t ch = query[i];
query[i] = '%';
CHECK_XPATH_FAIL(query);
query[i] = ch;
}
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment