From 4762ed9131aef55f56f26a7951d490e02891169c Mon Sep 17 00:00:00 2001 From: Alexandr Evstigneev Date: Sun, 15 Sep 2024 13:13:59 +0400 Subject: [PATCH] #2894 two tests still failing --- .../java/intellilang/PerlQuickEditTest.kt | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/plugin/src/test/java/intellilang/PerlQuickEditTest.kt b/plugin/src/test/java/intellilang/PerlQuickEditTest.kt index d563850fb2..cba7d27335 100644 --- a/plugin/src/test/java/intellilang/PerlQuickEditTest.kt +++ b/plugin/src/test/java/intellilang/PerlQuickEditTest.kt @@ -141,6 +141,46 @@ class PerlQuickEditTest : PerlLightTestCase() { ) } + @Test + fun testEmptyHeredoc() { + val (originalEditor, fragmentFile) = initFileWithTestSample( + """ + use v5.36; + + sub foo{ + say <<~HTML; + + HTML + }""".trimIndent(), + "" + ) + + myFixture.type("\n hello\n there\n") + assertFalse(myFixture.editor.isDisposed) + assertEquals( + """ + + hello + there + + """.trimIndent(), myFixture.editor.document.text.trim().replace(Regex("[ \t]+\n"), "\n") + ) + + assertEquals( + """ + use v5.36; + + sub foo{ + say <<~HTML; + + hello + there + + HTML + }""".trimIndent(), originalEditor.document.text + ) + } + @Test fun testReplaceHeredoc() { val (originalEditor, fragmentFile) = initFileWithTestSample()