Fix negative quickfix tests which use when
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
// "Add '<*, *>'" "false"
|
||||
// "Add '<*>'" "false"
|
||||
// ERROR: 2 type arguments expected
|
||||
// ACTION: Disable 'Eliminate Argument of 'when''
|
||||
// ACTION: Disable 'Replace 'when' with 'if''
|
||||
// ACTION: Edit intention settings
|
||||
// ACTION: Edit intention settings
|
||||
// ACTION: Eliminate argument of 'when'
|
||||
// ACTION: Replace 'when' with 'if'
|
||||
public fun foo(a: Any) {
|
||||
when (a) {
|
||||
is <caret>Map<Int> -> {}
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
// ERROR: 'else' entry must be the last one in a when-expression
|
||||
// ERROR: Unreachable code
|
||||
// ERROR: Unreachable code
|
||||
// ACTION: Disable 'Eliminate Argument of 'when''
|
||||
// ACTION: Edit intention settings
|
||||
// ACTION: Eliminate argument of 'when'
|
||||
package foo
|
||||
|
||||
fun foo() {
|
||||
|
||||
@@ -19,8 +19,8 @@ package org.jetbrains.jet.plugin.quickfix;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.Collections2;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Ordering;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.testFramework.UsefulTestCase;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -73,16 +73,16 @@ public class QuickFixActionsUtils {
|
||||
|
||||
public static void checkAvailableActionsAreExpected(JetFile file, Collection<IntentionAction> availableActions) {
|
||||
List<String> validActions = Ordering.natural().sortedCopy(
|
||||
Sets.newHashSet(InTextDirectivesUtils.findLinesWithPrefixesRemoved(file.getText(), "// ACTION:")));
|
||||
Lists.newArrayList(InTextDirectivesUtils.findLinesWithPrefixesRemoved(file.getText(), "// ACTION:")));
|
||||
|
||||
Collection<String> actualActions = Ordering.natural().sortedCopy(
|
||||
Collections2.transform(availableActions, new Function<IntentionAction, String>() {
|
||||
Lists.newArrayList(Collections2.transform(availableActions, new Function<IntentionAction, String>() {
|
||||
@Override
|
||||
public String apply(@Nullable IntentionAction input) {
|
||||
assert input != null;
|
||||
return input.getText();
|
||||
}
|
||||
}));
|
||||
})));
|
||||
|
||||
UsefulTestCase.assertOrderedEquals("Some unexpected actions available at current position: %s. Use // ACTION: directive",
|
||||
actualActions, validActions);
|
||||
|
||||
Reference in New Issue
Block a user