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());
}