Misc: Skip duplicates in navigation tests
This commit is contained in:
Vendored
-1
@@ -8,7 +8,6 @@ class ExpectedChildChild : ExpectedChild()
|
||||
|
||||
class SimpleChild : SimpleParent()
|
||||
|
||||
// REF: [common] (test).ExpectedChild
|
||||
// REF: [common] (test).ExpectedChild
|
||||
// REF: [common] (test).ExpectedChildChild
|
||||
// REF: [common] (test).SimpleChild
|
||||
|
||||
@@ -33,8 +33,10 @@ import com.intellij.testFramework.fixtures.CodeInsightTestUtil;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.intellij.util.containers.MultiMap;
|
||||
import junit.framework.TestCase;
|
||||
import kotlin.collections.ArraysKt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.asJava.LightClassUtilsKt;
|
||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils;
|
||||
import org.jetbrains.kotlin.test.util.ReferenceUtils;
|
||||
import org.junit.Assert;
|
||||
@@ -68,8 +70,9 @@ public final class NavigationTestUtils {
|
||||
Collections.sort(expectedReferences);
|
||||
|
||||
if (gotoData != null) {
|
||||
List<PsiElement> distinctTargets = ArraysKt.distinctBy(gotoData.targets, element -> LightClassUtilsKt.getUnwrapped(element));
|
||||
// Transform given reference result to strings
|
||||
List<String> psiElements = Lists.transform(Arrays.asList(gotoData.targets), new Function<PsiElement, String>() {
|
||||
List<String> psiElements = Lists.transform(distinctTargets, new Function<PsiElement, String>() {
|
||||
@Override
|
||||
public String apply(@Nullable PsiElement element) {
|
||||
Assert.assertNotNull(element);
|
||||
|
||||
Reference in New Issue
Block a user