+
+ @Test
+ public void testCurrentPredicateParsing() {
+ final YangLocationPath path = ((LocationPathSteps) parser.parseExpression(ctx,
+ "/device_types/device_type[type = current()/../type_text]/desc").getSteps()).getLocationPath();
+ assertTrue(path.isAbsolute());
+
+ path.getSteps();
+ assertEquals(ImmutableList.of(
+ YangXPathAxis.CHILD.asStep(UnqualifiedQName.of("device_types")),
+ YangXPathAxis.CHILD.asStep(UnqualifiedQName.of("device_type"),
+ ImmutableSet.of(YangBinaryOperator.EQUALS.exprWith(
+ YangQNameExpr.of(UnqualifiedQName.of("type")),
+ YangPathExpr.of(YangFunctionCallExpr.of(YangFunction.CURRENT.getIdentifier()), Relative.relative(
+ YangXPathAxis.PARENT.asStep(),
+ YangXPathAxis.CHILD.asStep(UnqualifiedQName.of("type_text"))))))),
+ YangXPathAxis.CHILD.asStep(UnqualifiedQName.of("desc"))), path.getSteps());
+ }