Package org.intellij.erlang.psi

Examples of org.intellij.erlang.psi.ErlangFunClause


  public void testFunExpressionSourcePositionConstructor() throws Exception {
    ErlangSourcePosition sourcePosition =
      ErlangSourcePosition.create(getProject(), MODULE_NAME, "-function_with_fun_expression/0-fun-0-", 0);
    ErlangFunction function = myErlangFile.getFunction("function_with_fun_expression", 0);
    ErlangFunExpression funExpression = PsiTreeUtil.findChildOfType(function, ErlangFunExpression.class, true);
    ErlangFunClause funExpressionClause = PsiTreeUtil.findChildOfType(funExpression, ErlangFunClause.class, true);

    assertNotNull(sourcePosition);
    assertNotNull(function);
    assertNotNull(funExpression);
    assertNotNull(funExpressionClause);

    assertEquals(MODULE_NAME, sourcePosition.getErlangModuleName());
    assertEquals(myErlangFile.getVirtualFile(), sourcePosition.getFile());
    assertEquals(0, sourcePosition.getFunctionArity());
    assertEquals(funExpressionClause.getArgumentDefinitionList().getArgumentDefinitionList().size(), sourcePosition.getFunExpressionArity());
    assertEquals(funExpression.getTextOffset(), sourcePosition.getSourcePosition().getOffset());
  }
View Full Code Here

TOP

Related Classes of org.intellij.erlang.psi.ErlangFunClause

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.