Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ffb5f2
commit a8485fc
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
defmodule One do | ||
@two %{} | ||
@two[three<caret>] | ||
end |
41 changes: 41 additions & 0 deletions
41
tests/org/elixir_lang/reference/callable/Issue659Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; | ||
} | ||
} |