Skip to content

Commit

Permalink
Failing regression test for #659
Browse files Browse the repository at this point in the history
  • Loading branch information
KronicDeth committed Jul 24, 2017
1 parent 4ffb5f2 commit a8485fc
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
4 changes: 4 additions & 0 deletions testData/org/elixir_lang/reference/callable/issue_659/is.ex
@@ -0,0 +1,4 @@
defmodule One do
@two %{}
@two[three<caret>]
end
41 changes: 41 additions & 0 deletions tests/org/elixir_lang/reference/callable/Issue659Test.java
@@ -0,0 +1,41 @@
package org.elixir_lang.reference.callable;

import com.intellij.psi.PsiElement;
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
import org.elixir_lang.psi.call.Call;

import static org.elixir_lang.reference.Callable.isParameter;
import static org.elixir_lang.reference.Callable.isVariable;

public class Issue659Test extends LightCodeInsightFixtureTestCase {
/*
* Tests
*/

public void testIs() {
myFixture.configureByFiles("is.ex");
PsiElement callable = myFixture
.getFile()
.findElementAt(myFixture.getCaretOffset())
.getPrevSibling();

assertInstanceOf(callable, Call.class);
assertFalse(
"unresolvable no argument call in at bracket operation is incorrectly marked as a parameter",
isParameter(callable)
);
assertFalse(
"unresolvable no argument call in at bracket operation is incorrectly marked as a variable",
isVariable(callable)
);
}

/*
* Protected Instance Methods
*/

@Override
protected String getTestDataPath() {
return "testData/org/elixir_lang/reference/callable/issue_659";
}
}

0 comments on commit a8485fc

Please sign in to comment.