mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-74544 Copy-Paste a string literal with '\n' character inserts actual line-feed instead of '\n'
All elements from the copied text are correctly parsed now and only string literal content is un-escaped if necessary now
This commit is contained in:
-25
@@ -1,25 +0,0 @@
|
||||
package com.intellij.codeInsight.editorActions;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* @author Denis Zhdanov
|
||||
* @since 10/4/11 1:28 PM
|
||||
*/
|
||||
public class StringLiteralCopyPasteProcessorTest {
|
||||
|
||||
@Test
|
||||
public void escapePastedStringLiteral() {
|
||||
doEscapePastedStringLiteralTest("identity", "identity");
|
||||
doEscapePastedStringLiteralTest("\"complete \n literal\"", "\"complete \\n literal\"");
|
||||
doEscapePastedStringLiteralTest("\"incomplete \n literal", "\"incomplete \n literal");
|
||||
doEscapePastedStringLiteralTest("partial \"string \n literal\"", "partial \"string \\n literal\"");
|
||||
}
|
||||
|
||||
private static void doEscapePastedStringLiteralTest(@NotNull String initial, @NotNull String expected) {
|
||||
assertEquals(expected, StringLiteralCopyPasteProcessor.escapePastedLiteral(initial));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user