mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
perform test with explicit UTF8
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package com.intellij.codeInsight.editorActions;
|
||||
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
|
||||
|
||||
/**
|
||||
@@ -62,12 +63,15 @@ public class EscapeEntitiesActionTest extends LightCodeInsightFixtureTestCase {
|
||||
"<a><</a>\n");
|
||||
}
|
||||
|
||||
private void doTest(String text, String extension, String expected) {
|
||||
if (!text.contains("<selection>")) {
|
||||
text = "<selection>" + text + "</selection>";
|
||||
}
|
||||
myFixture.configureByText(getTestName(true) + "." + extension, text);
|
||||
myFixture.performEditorAction("EscapeEntities");
|
||||
myFixture.checkResult(expected);
|
||||
private void doTest(String text, final String extension, final String expected) {
|
||||
final String finalText = !text.contains("<selection>") ? "<selection>" + text + "</selection>" : text;
|
||||
PlatformTestUtil.withEncoding("UTF8", new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
myFixture.configureByText(getTestName(true) + "." + extension, finalText);
|
||||
myFixture.performEditorAction("EscapeEntities");
|
||||
myFixture.checkResult(expected);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user