From 1363ec1f9b4c55905819bab28cd5146cd5ff816b Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 26 Sep 2018 08:09:43 +0200 Subject: [PATCH] make mad testing completion expectation checks work for case-insensitive suggestions --- .../testFramework/propertyBased/InvokeCompletion.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/testFramework/src/com/intellij/testFramework/propertyBased/InvokeCompletion.java b/platform/testFramework/src/com/intellij/testFramework/propertyBased/InvokeCompletion.java index a9eb1a196fdd..974862b4dcb1 100644 --- a/platform/testFramework/src/com/intellij/testFramework/propertyBased/InvokeCompletion.java +++ b/platform/testFramework/src/com/intellij/testFramework/propertyBased/InvokeCompletion.java @@ -28,6 +28,7 @@ import com.intellij.openapi.editor.impl.EditorImpl; import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.fileEditor.OpenFileDescriptor; import com.intellij.openapi.project.Project; +import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.util.text.StringUtil; @@ -130,7 +131,9 @@ public class InvokeCompletion extends ActionOnFile { List items = lookup.getItems(); if (expectedVariant != null) { - LookupElement sameItem = ContainerUtil.find(items, e -> e.getAllLookupStrings().contains(expectedVariant)); + LookupElement sameItem = ContainerUtil.find(items, e -> + e.getAllLookupStrings().stream().anyMatch( + s -> Comparing.equal(s, expectedVariant, e.isCaseSensitive()))); TestCase.assertNotNull("No variant '" + expectedVariant + "' among " + items + notFound, sameItem); }