Add test case
This commit is contained in:
1 parent
49cd0b3e16
commit
1102f936c8
1 file changed
+10
+10
@@ -373,6 +373,16 @@ class SaxonXPathRuleQueryTest {
|
||||
assertExpression(expectedSubexpression, query.nodeNameToXPaths.get("DoStatement").get(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
void ruleChainVisitsWithUnionsAndLets() {
|
||||
PropertyDescriptor<Boolean> boolProperty = PropertyFactory.booleanProperty("checkAll").desc("test").defaultValue(true).build();
|
||||
SaxonXPathRuleQuery query = createQuery("//dummyNode[$checkAll and ClassOrInterfaceType] | //ForStatement[not($checkAll)]", boolProperty);
|
||||
List<String> ruleChainVisits = query.getRuleChainVisits();
|
||||
assertEquals(2, ruleChainVisits.size());
|
||||
assertTrue(ruleChainVisits.contains("dummyNode"));
|
||||
assertTrue(ruleChainVisits.contains("ForStatement"));
|
||||
}
|
||||
|
||||
private static void assertExpression(String expected, Expression actual) {
|
||||
assertEquals(normalizeExprDump(expected),
|
||||
normalizeExprDump(actual.toString()));
|
||||
|
||||
Reference in new issue
Block a user