mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
enable registry setting before test if it is not enabled
This commit is contained in:
+18
-11
@@ -23,6 +23,7 @@ import com.intellij.openapi.editor.actionSystem.TypedAction;
|
||||
import com.intellij.openapi.editor.ex.EditorEx;
|
||||
import com.intellij.openapi.fileTypes.FileTypes;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -111,19 +112,25 @@ public class SelectionQuotingTypedHandlerTest extends LightPlatformCodeInsightFi
|
||||
}
|
||||
|
||||
private void doTest(@NotNull final String cs, @NotNull String before, @NotNull String expected) {
|
||||
myFixture.configureByText(FileTypes.PLAIN_TEXT, before);
|
||||
final TypedAction typedAction = EditorActionManager.getInstance().getTypedAction();
|
||||
final boolean smarterSelection = Registry.is("editor.smarterSelectionQuoting");
|
||||
Registry.get("editor.smarterSelectionQuoting").setValue(true);
|
||||
try {
|
||||
myFixture.configureByText(FileTypes.PLAIN_TEXT, before);
|
||||
final TypedAction typedAction = EditorActionManager.getInstance().getTypedAction();
|
||||
|
||||
performAction(myFixture.getProject(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (int i = 0, max = cs.length(); i < max; i++) {
|
||||
final char c = cs.charAt(i);
|
||||
typedAction.actionPerformed(myFixture.getEditor(), c, ((EditorEx)myFixture.getEditor()).getDataContext());
|
||||
performAction(myFixture.getProject(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (int i = 0, max = cs.length(); i < max; i++) {
|
||||
final char c = cs.charAt(i);
|
||||
typedAction.actionPerformed(myFixture.getEditor(), c, ((EditorEx)myFixture.getEditor()).getDataContext());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
myFixture.checkResult(expected);
|
||||
});
|
||||
myFixture.checkResult(expected);
|
||||
} finally {
|
||||
Registry.get("editor.smarterSelectionQuoting").setValue(smarterSelection);
|
||||
}
|
||||
}
|
||||
|
||||
public void testRuby7852ErrantEditor() {
|
||||
|
||||
Reference in New Issue
Block a user