package com.reason.ide;

import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
import com.intellij.usageView.UsageInfo;

import java.util.Collection;

@SuppressWarnings("ConstantConditions")
public class FindLIdentUsagesTest extends LightPlatformCodeInsightFixtureTestCase {

    public void testFromModule() {
        myFixture.configureByText("A.re", "let x<caret> = 1;");
        myFixture.configureByText("B.re", "let y = A.x + 2;");

        Collection<UsageInfo> usages = myFixture.testFindUsages("A.re");
        assertSize(1, usages);

    }

    public void testSameModule() {
        myFixture.configureByText("A.re", "let x<caret> = 1; let y = x + 1;");

        Collection<UsageInfo> usages = myFixture.testFindUsages("A.re");
        assertSize(1, usages);
        UsageInfo usageInfo = usages.iterator().next();
        assertEquals("x + 1", usageInfo.getElement().getParent().getText());
    }

}

@@ -172,16 +172,39 @@
 lection;
+%0Aimport java.util.List;
 %0A%0A@Suppr
@@ -384,32 +384,35 @@
 onfigureByText(%22
+FLI
 A.re%22, %22let x%3Cca
@@ -459,16 +459,19 @@
 ByText(%22
+FLI
 B.re%22, %22
@@ -478,16 +478,19 @@
 let y = 
+FLI
 A.x + 2;
@@ -551,32 +551,35 @@
 testFindUsages(%22
+FLI
 A.re%22);%0A        
@@ -581,33 +581,33 @@
      assertSize(
-1
+2
 , usages);%0A%0A    
@@ -679,17 +679,20 @@
 ByText(%22
-A
+FLIC
 .re%22, %22l
@@ -731,34 +731,28 @@
 );%0A%0A        
-Collection
+List
 %3CUsageInfo%3E 
@@ -751,32 +751,50 @@
 geInfo%3E usages =
+ (List%3CUsageInfo%3E)
  myFixture.testF
@@ -804,17 +804,20 @@
 Usages(%22
-A
+FLIC
 .re%22);%0A 
@@ -834,17 +834,17 @@
 ertSize(
-1
+2
 , usages
@@ -887,24 +887,13 @@
 ges.
-iterator().next(
+get(1
 );%0A 

fix test