Search in sources :

Example 1 with XPath2SequenceType

use of org.intellij.lang.xpath.psi.XPath2SequenceType in project intellij-community by JetBrains.

the class XPath2ExpressionTest method doTest.

protected XPathType doTest(boolean symmetric) throws Throwable {
    myFixture.configureByFile(getTestFileName() + ".xpath2");
    final XPathExpression expression = getExpression();
    // all these cases must be green
    myFixture.checkHighlighting();
    if (symmetric && expression instanceof XPathBinaryExpression) {
        final XPathBinaryExpression expr = (XPathBinaryExpression) expression;
        if (expr.getLOperand().getType() != expr.getROperand().getType()) {
            myFixture.configureByText(XPathFileType.XPATH2, expr.getROperand().getText() + " " + expr.getOperationSign() + " " + expr.getLOperand().getText());
            assertEquals(getExpression().getType(), expression.getType());
            myFixture.checkHighlighting();
        }
    }
    final XPathType type = expression.getType();
    if (type instanceof XPath2SequenceType) {
        return ((XPath2SequenceType) type).getType();
    }
    return type;
}
Also used : XPathExpression(org.intellij.lang.xpath.psi.XPathExpression) XPathType(org.intellij.lang.xpath.psi.XPathType) XPathBinaryExpression(org.intellij.lang.xpath.psi.XPathBinaryExpression) XPath2SequenceType(org.intellij.lang.xpath.psi.XPath2SequenceType)

Aggregations

XPath2SequenceType (org.intellij.lang.xpath.psi.XPath2SequenceType)1 XPathBinaryExpression (org.intellij.lang.xpath.psi.XPathBinaryExpression)1 XPathExpression (org.intellij.lang.xpath.psi.XPathExpression)1 XPathType (org.intellij.lang.xpath.psi.XPathType)1