Package org.intellij.erlang.debugger.xdebug

Examples of org.intellij.erlang.debugger.xdebug.ErlangSourcePosition


  protected String getTestDataPath() {
    return "testData/debugger/";
  }

  public void testFunctionSourcePositionConstructor() throws Exception {
    ErlangSourcePosition sourcePosition = ErlangSourcePosition.create(getProject(), MODULE_NAME, "function", 0);
    ErlangFunction function = myErlangFile.getFunction("function", 0);

    assertNotNull(sourcePosition);
    assertNotNull(function);
    assertEquals(MODULE_NAME, sourcePosition.getErlangModuleName());
    assertEquals(myErlangFile.getVirtualFile(), sourcePosition.getFile());
    assertEquals(function.getTextOffset(), sourcePosition.getSourcePosition().getOffset());
    assertEquals(0, sourcePosition.getFunctionArity());
    assertEquals(-1, sourcePosition.getFunExpressionArity());
  }
View Full Code Here


    assertEquals(0, sourcePosition.getFunctionArity());
    assertEquals(-1, sourcePosition.getFunExpressionArity());
  }

  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.debugger.xdebug.ErlangSourcePosition

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.