mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-02 00:57:59 +07:00
Fixed unnecessarily escaped character in tests
GitOrigin-RevId: 0728ecbede9fa655d528b33751063ef28a4ff978
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3e0796cd99
commit
f5425ef66f
+1
-1
@@ -48,7 +48,7 @@ public class RemoveSillyAssignmentFixTest extends LightJavaCodeInsightFixtureTes
|
||||
myFixture.enableInspections(SillyAssignmentInspection.class);
|
||||
final String quickfixName = JavaBundle.message("assignment.to.itself.quickfix.name");
|
||||
myFixture.configureByFile(getTestName(false) + ".java");
|
||||
assertEmpty("Quickfix \'" + quickfixName + "\' is available unexpectedly", myFixture.filterAvailableIntentions(quickfixName));
|
||||
assertEmpty("Quickfix '" + quickfixName + "' is available unexpectedly", myFixture.filterAvailableIntentions(quickfixName));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class SameParameterValueSlashesTest extends LightJavaCodeInsightFixtureTe
|
||||
|
||||
@Parameterized.Parameters(name = "\\{0}")
|
||||
public static Object[] data() {
|
||||
return new Object[] { "n", "r", "b", "t", "f", "\"", "\'", "\\", "1"};
|
||||
return new Object[] { "n", "r", "b", "t", "f", "\"", "'", "\\", "1"};
|
||||
}
|
||||
|
||||
@Parameterized.Parameter
|
||||
|
||||
+1
@@ -14,6 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class TextBlockBackwardMigrationInspectionTest extends LightQuickFixParameterizedTestCase {
|
||||
|
||||
public void testTrailingWhitespace() {
|
||||
//noinspection UnnecessaryStringEscape
|
||||
configureFromFileText("TrailingWhitespace.java", "class TextBlockMigration {\n" +
|
||||
"\n" +
|
||||
" String multipleLiterals() {\n" +
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ public class SelectionQuotingTypedHandlerTest extends BasePlatformTestCase {
|
||||
}
|
||||
|
||||
public void testChangeQuotes() {
|
||||
doTest("\'", "<selection><caret>\"aaa\"</selection>\nbbb\n\n", "'aaa'\nbbb\n\n");
|
||||
doTest("'", "<selection><caret>\"aaa\"</selection>\nbbb\n\n", "'aaa'\nbbb\n\n");
|
||||
}
|
||||
|
||||
public void testChangeBrackets() {
|
||||
|
||||
+22
-22
@@ -160,15 +160,15 @@ public class CustomFileTypeEditorTest extends BasePlatformTestCase {
|
||||
boolean oldValuePairQuote = settings.AUTOINSERT_PAIR_QUOTE;
|
||||
settings.AUTOINSERT_PAIR_QUOTE = false;
|
||||
try {
|
||||
checkTyping("a.cs", "<caret><selection>\"</selection>a\"", '\'', "\'<caret>a\"");
|
||||
checkTyping("a.cs", "<caret><selection>\"</selection>a\'", '\'', "\'<caret>a\'");
|
||||
checkTyping("a.cs", "\"a<caret><selection>\"</selection>", '\'', "\"a\'<caret>");
|
||||
checkTyping("a.cs", "\'a<caret><selection>\"</selection>", '\'', "\'a\'<caret>");
|
||||
checkTyping("a.cs", "<caret><selection>\"</selection>a\"", '\'', "'<caret>a\"");
|
||||
checkTyping("a.cs", "<caret><selection>\"</selection>a'", '\'', "'<caret>a'");
|
||||
checkTyping("a.cs", "\"a<caret><selection>\"</selection>", '\'', "\"a'<caret>");
|
||||
checkTyping("a.cs", "'a<caret><selection>\"</selection>", '\'', "'a'<caret>");
|
||||
|
||||
checkTyping("a.cs", "<caret><selection>\'</selection>a\"", '\"', "\"<caret>a\"");
|
||||
checkTyping("a.cs", "<caret><selection>\'</selection>a\'", '\"', "\"<caret>a\'");
|
||||
checkTyping("a.cs", "\"a<caret><selection>\'</selection>", '\"', "\"a\"<caret>");
|
||||
checkTyping("a.cs", "\'a<caret><selection>\'</selection>", '\"', "\'a\"<caret>");
|
||||
checkTyping("a.cs", "<caret><selection>'</selection>a\"", '\"', "\"<caret>a\"");
|
||||
checkTyping("a.cs", "<caret><selection>'</selection>a'", '\"', "\"<caret>a'");
|
||||
checkTyping("a.cs", "\"a<caret><selection>'</selection>", '\"', "\"a\"<caret>");
|
||||
checkTyping("a.cs", "'a<caret><selection>'</selection>", '\"', "'a\"<caret>");
|
||||
}
|
||||
finally {
|
||||
settings.SURROUND_SELECTION_ON_QUOTE_TYPED = oldValue;
|
||||
@@ -181,14 +181,14 @@ public class CustomFileTypeEditorTest extends BasePlatformTestCase {
|
||||
boolean oldValue = settings.AUTOINSERT_PAIR_QUOTE;
|
||||
settings.AUTOINSERT_PAIR_QUOTE = false;
|
||||
try {
|
||||
checkTyping("a.cs", "<caret><selection>\"</selection>a\"", '\'', "\'<selection><caret>\"</selection>\'a\"");
|
||||
checkTyping("a.cs", "<caret><selection>\"</selection>a\'", '\'', "\'<selection><caret>\"</selection>\'a\'");
|
||||
checkTyping("a.cs", "\"a<caret><selection>\"</selection>", '\'', "\"a\'<selection><caret>\"</selection>\'");
|
||||
checkTyping("a.cs", "\'a<caret><selection>\"</selection>", '\'', "\'a\'<selection><caret>\"</selection>\'");
|
||||
checkTyping("a.cs", "<caret><selection>\'</selection>a\"", '\"', "\"<selection><caret>\'</selection>\"a\"");
|
||||
checkTyping("a.cs", "<caret><selection>\'</selection>a\'", '\"', "\"<selection><caret>\'</selection>\"a\'");
|
||||
checkTyping("a.cs", "\"a<caret><selection>\'</selection>", '\"', "\"a\"<selection><caret>\'</selection>\"");
|
||||
checkTyping("a.cs", "\'a<caret><selection>\'</selection>", '\"', "\'a\"<selection><caret>\'</selection>\"");
|
||||
checkTyping("a.cs", "<caret><selection>\"</selection>a\"", '\'', "'<selection><caret>\"</selection>'a\"");
|
||||
checkTyping("a.cs", "<caret><selection>\"</selection>a'", '\'', "'<selection><caret>\"</selection>'a'");
|
||||
checkTyping("a.cs", "\"a<caret><selection>\"</selection>", '\'', "\"a'<selection><caret>\"</selection>'");
|
||||
checkTyping("a.cs", "'a<caret><selection>\"</selection>", '\'', "'a'<selection><caret>\"</selection>'");
|
||||
checkTyping("a.cs", "<caret><selection>'</selection>a\"", '\"', "\"<selection><caret>'</selection>\"a\"");
|
||||
checkTyping("a.cs", "<caret><selection>'</selection>a'", '\"', "\"<selection><caret>'</selection>\"a'");
|
||||
checkTyping("a.cs", "\"a<caret><selection>'</selection>", '\"', "\"a\"<selection><caret>'</selection>\"");
|
||||
checkTyping("a.cs", "'a<caret><selection>'</selection>", '\"', "'a\"<selection><caret>'</selection>\"");
|
||||
}
|
||||
finally {
|
||||
settings.AUTOINSERT_PAIR_QUOTE = oldValue;
|
||||
@@ -197,13 +197,13 @@ public class CustomFileTypeEditorTest extends BasePlatformTestCase {
|
||||
|
||||
public void testReplaceQuote() {
|
||||
checkTyping("a.cs", "<caret><selection>\"</selection>a\"", '\'', "'<caret>a'");
|
||||
checkTyping("a.cs", "<caret><selection>\"</selection>a\'", '\'', "\'<selection><caret>\"</selection>\'a\'");
|
||||
checkTyping("a.cs", "<caret><selection>\"</selection>a'", '\'', "'<selection><caret>\"</selection>'a'");
|
||||
checkTyping("a.cs", "\"a<caret><selection>\"</selection>", '\'', "'a'<caret>");
|
||||
checkTyping("a.cs", "\'a<caret><selection>\"</selection>", '\'', "\'a\'<selection><caret>\"</selection>\'");
|
||||
checkTyping("a.cs", "<caret><selection>\'</selection>a\"", '\"', "\"<selection><caret>\'</selection>\"a\"");
|
||||
checkTyping("a.cs", "<caret><selection>\'</selection>a\'", '\"', "\"<caret>a\"");
|
||||
checkTyping("a.cs", "\"a<caret><selection>\'</selection>", '\"', "\"a\"<selection><caret>\'</selection>\"");
|
||||
checkTyping("a.cs", "\'a<caret><selection>\'</selection>", '\"', "\"a\"<caret>");
|
||||
checkTyping("a.cs", "'a<caret><selection>\"</selection>", '\'', "'a'<selection><caret>\"</selection>'");
|
||||
checkTyping("a.cs", "<caret><selection>'</selection>a\"", '\"', "\"<selection><caret>'</selection>\"a\"");
|
||||
checkTyping("a.cs", "<caret><selection>'</selection>a'", '\"', "\"<caret>a\"");
|
||||
checkTyping("a.cs", "\"a<caret><selection>'</selection>", '\"', "\"a\"<selection><caret>'</selection>\"");
|
||||
checkTyping("a.cs", "'a<caret><selection>'</selection>", '\"', "\"a\"<caret>");
|
||||
}
|
||||
|
||||
public void testReplacePairBrace() {
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class SoftWrapTest extends AbstractEditorTest {
|
||||
doTestSoftWraps(10, "start<fold text='.....'>text with space</fold><wrap>end");
|
||||
}
|
||||
|
||||
private static final String TAGS_PATTERN = "(<fold(\\stext=\'([^\']*)\')?>)|(</fold>)|<wrap>";
|
||||
private static final String TAGS_PATTERN = "(<fold(\\stext='([^']*)')?>)|(</fold>)|<wrap>";
|
||||
|
||||
private void doTestSoftWraps(int wrapWidth, String text) {
|
||||
List<MyFoldRegion> foldRegions = new ArrayList<>();
|
||||
|
||||
@@ -59,14 +59,14 @@ public abstract class IGQuickFixesTestCase extends JavaCodeInsightFixtureTestCas
|
||||
protected void assertQuickfixNotAvailable(final String quickfixName) {
|
||||
final String testName = getTestName(false);
|
||||
myFixture.configureByFile(getRelativePath() + "/" + testName + ".java");
|
||||
assertEmpty("Quickfix \'" + quickfixName + "\' is available but should not",
|
||||
assertEmpty("Quickfix '" + quickfixName + "' is available but should not",
|
||||
myFixture.filterAvailableIntentions(quickfixName));
|
||||
}
|
||||
|
||||
protected void assertQuickfixNotAvailable(String quickfixName, @Language("JAVA") @NotNull String text) {
|
||||
text = text.replace("/**/", "<caret>");
|
||||
myFixture.configureByText(JavaFileType.INSTANCE, text);
|
||||
assertEmpty("Quickfix \'" + quickfixName + "\' is available but should not",
|
||||
assertEmpty("Quickfix '" + quickfixName + "' is available but should not",
|
||||
myFixture.filterAvailableIntentions(quickfixName));
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ public abstract class IPPTestCase extends LightJavaCodeInsightFixtureTestCase {
|
||||
myFixture.configureByText("a.java", matcher.replaceFirst("<caret>"));
|
||||
final String group = matcher.group(1);
|
||||
final String intentionName = group.isEmpty() ? getIntentionName() : group;
|
||||
assertEmpty("Intention \'" + intentionName + "\' is available but should not", myFixture.filterAvailableIntentions(intentionName));
|
||||
assertEmpty("Intention '" + intentionName + "' is available but should not", myFixture.filterAvailableIntentions(intentionName));
|
||||
}
|
||||
|
||||
protected void assertIntentionNotAvailable() {
|
||||
@@ -78,7 +78,7 @@ public abstract class IPPTestCase extends LightJavaCodeInsightFixtureTestCase {
|
||||
protected void assertIntentionNotAvailable(@NotNull final String intentionName) {
|
||||
final String testName = getTestName(false);
|
||||
myFixture.configureByFile(testName + ".java");
|
||||
assertEmpty("Intention \'" + intentionName + "\' is available but should not", myFixture.filterAvailableIntentions(intentionName));
|
||||
assertEmpty("Intention '" + intentionName + "' is available but should not", myFixture.filterAvailableIntentions(intentionName));
|
||||
}
|
||||
|
||||
protected void assertIntentionNotAvailable(Class<? extends IntentionAction> intentionClass) {
|
||||
@@ -89,7 +89,7 @@ public abstract class IPPTestCase extends LightJavaCodeInsightFixtureTestCase {
|
||||
result.add(intention);
|
||||
}
|
||||
}
|
||||
assertEmpty("Intention of class \'" + intentionClass + "\' is available but should not", result);
|
||||
assertEmpty("Intention of class '" + intentionClass + "' is available but should not", result);
|
||||
}
|
||||
|
||||
protected String getIntentionName() {
|
||||
|
||||
@@ -84,7 +84,7 @@ public class GitScenarios {
|
||||
* Branch must not exist at this point.
|
||||
*/
|
||||
public static String conflict(GitRepository repository, String branch, String file) {
|
||||
assert !branchExists(repository, branch) : "Branch [" + branch + "] shouldn\'t exist for this scenario";
|
||||
assert !branchExists(repository, branch) : "Branch [" + branch + "] shouldn't exist for this scenario";
|
||||
|
||||
cd(repository);
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ public class MqPatchTest extends HgPlatformTest {
|
||||
touch(FILENAME, "f1");
|
||||
myRepository.refresh(false, true);
|
||||
hg("add " + FILENAME);
|
||||
hg("commit -m \'" + MESSAGE + "\'");
|
||||
hg("commit -m '" + MESSAGE + "'");
|
||||
HgTestUtil.updateDirectoryMappings(myProject, myRepository);
|
||||
myHgRepository = HgUtil.getRepositoryManager(myProject).getRepositoryForRoot(myRepository);
|
||||
assert myHgRepository != null;
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public class MarkdownQuoteHandlerTest extends BasePlatformTestCase {
|
||||
}
|
||||
|
||||
public void testSingleQuoteAsApostrophe() {
|
||||
doTest("Hello dear<caret> world", '\'', "Hello dear\'<caret> world");
|
||||
doTest("Hello dear<caret> world", '\'', "Hello dear'<caret> world");
|
||||
}
|
||||
|
||||
public void testBacktickAsAccent() {
|
||||
|
||||
@@ -268,8 +268,8 @@ public class PyEvaluatorTest extends PyTestCase {
|
||||
assertTrue(PyEvaluator.evaluateAsBoolean(parseExpression("True")));
|
||||
assertFalse(PyEvaluator.evaluateAsBoolean(parseExpression("False")));
|
||||
|
||||
assertTrue(PyEvaluator.evaluateAsBoolean(parseExpression("\'a\'")));
|
||||
assertFalse(PyEvaluator.evaluateAsBoolean(parseExpression("\'\'")));
|
||||
assertTrue(PyEvaluator.evaluateAsBoolean(parseExpression("'a'")));
|
||||
assertFalse(PyEvaluator.evaluateAsBoolean(parseExpression("''")));
|
||||
|
||||
assertTrue(PyEvaluator.evaluateAsBoolean(parseExpression("1")));
|
||||
assertFalse(PyEvaluator.evaluateAsBoolean(parseExpression("0")));
|
||||
@@ -285,8 +285,8 @@ public class PyEvaluatorTest extends PyTestCase {
|
||||
assertTrue(PyEvaluator.evaluateAsBooleanNoResolve(parseExpression("True")));
|
||||
assertFalse(PyEvaluator.evaluateAsBooleanNoResolve(parseExpression("False")));
|
||||
|
||||
assertTrue(PyEvaluator.evaluateAsBooleanNoResolve(parseExpression("\'a\'")));
|
||||
assertFalse(PyEvaluator.evaluateAsBooleanNoResolve(parseExpression("\'\'")));
|
||||
assertTrue(PyEvaluator.evaluateAsBooleanNoResolve(parseExpression("'a'")));
|
||||
assertFalse(PyEvaluator.evaluateAsBooleanNoResolve(parseExpression("''")));
|
||||
|
||||
assertTrue(PyEvaluator.evaluateAsBooleanNoResolve(parseExpression("1")));
|
||||
assertFalse(PyEvaluator.evaluateAsBooleanNoResolve(parseExpression("0")));
|
||||
@@ -300,8 +300,8 @@ public class PyEvaluatorTest extends PyTestCase {
|
||||
assertNull(PyEvaluator.evaluateAsBooleanNoResolve(parseText("a = True\nexpr = a")));
|
||||
assertNull(PyEvaluator.evaluateAsBooleanNoResolve(parseText("a = False\nexpr = a")));
|
||||
|
||||
assertNull(PyEvaluator.evaluateAsBooleanNoResolve(parseText("a = \'a\'\nexpr = a")));
|
||||
assertNull(PyEvaluator.evaluateAsBooleanNoResolve(parseText("a = \'\'\nexpr = a")));
|
||||
assertNull(PyEvaluator.evaluateAsBooleanNoResolve(parseText("a = 'a'\nexpr = a")));
|
||||
assertNull(PyEvaluator.evaluateAsBooleanNoResolve(parseText("a = ''\nexpr = a")));
|
||||
|
||||
assertNull(PyEvaluator.evaluateAsBooleanNoResolve(parseText("a = 1\nexpr = a")));
|
||||
assertNull(PyEvaluator.evaluateAsBooleanNoResolve(parseText("a = 0\nexpr = a")));
|
||||
|
||||
@@ -253,7 +253,7 @@ public class XmlDtdTest extends LightPlatformTestCase {
|
||||
|
||||
public void testEntityDecl4() {
|
||||
XmlNSDescriptor NSDescriptor = createDescriptor(
|
||||
"<!ENTITY % boolean \'(true|false|on|off|yes|no)\'> <!ENTITY % bool \"%boolean;\"> <!ELEMENT toc ANY> <!ATTLIST toc remote %bool; \"false\"");
|
||||
"<!ENTITY % boolean '(true|false|on|off|yes|no)'> <!ENTITY % bool \"%boolean;\"> <!ELEMENT toc ANY> <!ATTLIST toc remote %bool; \"false\"");
|
||||
|
||||
final XmlTag tag = tag("toc");
|
||||
XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag);
|
||||
|
||||
Reference in New Issue
Block a user