diff --git a/platform/platform-tests/testData/codeInsight/backspace/DifferentBrackets.txt b/platform/platform-tests/testData/codeInsight/backspace/DifferentBrackets.txt new file mode 100644 index 000000000000..67dbed781f62 --- /dev/null +++ b/platform/platform-tests/testData/codeInsight/backspace/DifferentBrackets.txt @@ -0,0 +1 @@ +([()]) \ No newline at end of file diff --git a/platform/platform-tests/testData/codeInsight/backspace/DifferentBrackets_after.txt b/platform/platform-tests/testData/codeInsight/backspace/DifferentBrackets_after.txt new file mode 100644 index 000000000000..b6a66056a446 --- /dev/null +++ b/platform/platform-tests/testData/codeInsight/backspace/DifferentBrackets_after.txt @@ -0,0 +1 @@ +([]) \ No newline at end of file diff --git a/platform/platform-tests/testSrc/com/intellij/codeInsight/PlainTextBackspaceTest.java b/platform/platform-tests/testSrc/com/intellij/codeInsight/PlainTextBackspaceTest.java new file mode 100644 index 000000000000..5a71d4fc17f9 --- /dev/null +++ b/platform/platform-tests/testSrc/com/intellij/codeInsight/PlainTextBackspaceTest.java @@ -0,0 +1,25 @@ +// 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.LightPlatformCodeInsightTestCase; +import com.intellij.testFramework.PlatformTestUtil; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; + +public class PlainTextBackspaceTest extends LightPlatformCodeInsightTestCase { + @NotNull + @Override + protected String getTestDataPath() { + return PlatformTestUtil.getPlatformTestDataPath(); + } + + public void testDifferentBrackets() { doTest(); } + + private void doTest() { + @NonNls String path = "/codeInsight/backspace/"; + + configureByFile(path + getTestName(false) + ".txt"); + backspace(); + checkResultByFile(path + getTestName(false) + "_after.txt"); + } +} diff --git a/xml/tests/src/com/intellij/codeInsight/XmlBackspaceTest.java b/xml/tests/src/com/intellij/codeInsight/XmlBackspaceTest.java new file mode 100644 index 000000000000..c89ddb7eaebe --- /dev/null +++ b/xml/tests/src/com/intellij/codeInsight/XmlBackspaceTest.java @@ -0,0 +1,24 @@ +// 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.LightPlatformCodeInsightTestCase; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; + +public class XmlBackspaceTest extends LightPlatformCodeInsightTestCase { + @Override + protected @NotNull String getTestDataPath() { + return XmlTestUtil.getXmlTestDataPath(); + } + + public void testQuoteInXml() { doTest(); } + public void testQuoteInXml2() { doTest(); } + + private void doTest() { + @NonNls String path = "/codeInsight/backspace/"; + + configureByFile(path + getTestName(false) + ".xml"); + backspace(); + checkResultByFile(path + getTestName(false) + "_after.xml"); + } +} diff --git a/xml/tests/testData/codeInsight/backspace/QuoteInXml.xml b/xml/tests/testData/codeInsight/backspace/QuoteInXml.xml new file mode 100644 index 000000000000..81ed977039f6 --- /dev/null +++ b/xml/tests/testData/codeInsight/backspace/QuoteInXml.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/xml/tests/testData/codeInsight/backspace/QuoteInXml2.xml b/xml/tests/testData/codeInsight/backspace/QuoteInXml2.xml new file mode 100644 index 000000000000..828b7bfd08b6 --- /dev/null +++ b/xml/tests/testData/codeInsight/backspace/QuoteInXml2.xml @@ -0,0 +1,2 @@ +"> + \ No newline at end of file diff --git a/xml/tests/testData/codeInsight/backspace/QuoteInXml2_after.xml b/xml/tests/testData/codeInsight/backspace/QuoteInXml2_after.xml new file mode 100644 index 000000000000..81ed977039f6 --- /dev/null +++ b/xml/tests/testData/codeInsight/backspace/QuoteInXml2_after.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/xml/tests/testData/codeInsight/backspace/QuoteInXml_after.xml b/xml/tests/testData/codeInsight/backspace/QuoteInXml_after.xml new file mode 100644 index 000000000000..43fbc80097e4 --- /dev/null +++ b/xml/tests/testData/codeInsight/backspace/QuoteInXml_after.xml @@ -0,0 +1,2 @@ +> + \ No newline at end of file