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()