Move plain text-specific part of EnterActionTest to platform-tests module

GitOrigin-RevId: 732eae92ffc94e0c792f7b263ffe0415cdeb0225
This commit is contained in:
Dmitry Jemerov
2022-05-13 18:58:53 +00:00
committed by intellij-monorepo-bot
parent 419c0d24cb
commit 6843b8a3f1
4 changed files with 61 additions and 0 deletions
@@ -0,0 +1,4 @@
text text text
text text text<caret>
text text
text tetetetetet
@@ -0,0 +1,5 @@
text text text
text text text
<caret>
text text
text tetetetetet
@@ -0,0 +1,52 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.codeInsight;
import com.intellij.testFramework.PlatformTestUtil;
import org.jetbrains.annotations.NotNull;
public class PlainTextEnterActionTest extends AbstractEnterActionTestCase {
@NotNull
@Override
protected String getTestDataPath() {
return PlatformTestUtil.getPlatformTestDataPath();
}
public void testEnterInTextFile() throws Exception {
doTest("txt");
}
public void testEnterWithSpacesAfterCaret() {
doTextTest("txt", "abc <caret> ", "abc \n<caret> ");
}
public void testSCR2236() {
doTextTest("txt", "//file/text/<caret>text/text", "//file/text/\n" + "<caret>text/text");
}
public void testUnmatchedBraceAtPlainTextFile() {
// Inspired by IDEA-64060
doTextTest(
"txt",
" class Foo {<caret>",
" class Foo {\n" +
" <caret>\n" +
" }"
);
}
public void testInJavaDocLikeStringOfPlainTextFile() {
// Inspired by IDEA-65108
doTextTest(
"txt",
"Here is a list of bullet points:\n" +
"* Bullet one. <caret>Bullet two.",
"Here is a list of bullet points:\n" +
"* Bullet one. \n" +
"<caret>Bullet two."
);
}
public void testIndentCalculationWithTabsInIndent() {
doTextTest("txt", "\t<caret>\tabc", "\t\n\t<caret>\tabc");
}
}