diff options
| author | Jay Arthanareeswaran | 2020-03-19 11:28:51 +0000 |
|---|---|---|
| committer | Jay Arthanareeswaran | 2020-03-19 11:29:21 +0000 |
| commit | 8f68ce4464f063259009e409d974e96ed60fe208 (patch) | |
| tree | 0356e0a7669a420d472bc1bfe640329ed90f3beb | |
| parent | 268f86fe8d807ed77eeb83bfc0abbf7661409e25 (diff) | |
| download | eclipse.jdt.core-8f68ce4464f063259009e409d974e96ed60fe208.tar.gz eclipse.jdt.core-8f68ce4464f063259009e409d974e96ed60fe208.tar.xz eclipse.jdt.core-8f68ce4464f063259009e409d974e96ed60fe208.zip | |
inserts an additional line
Change-Id: I34d6225df698a68289ff10dc497c3855ba1ce8fa
Signed-off-by: Jay Arthanareeswaran <jarthana@in.ibm.com>
2 files changed, 26 insertions, 2 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TextBlockTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TextBlockTest.java index e502dd40f6..32906fb2ef 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TextBlockTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TextBlockTest.java @@ -34,7 +34,7 @@ public class TextBlockTest extends AbstractRegressionTest { static { // TESTS_NUMBERS = new int [] { 40 }; -// TESTS_NAMES = new String[] { "testCompliances_13" }; +// TESTS_NAMES = new String[] { "testCompliances_14" }; } public static Class<?> testClass() { @@ -1283,6 +1283,31 @@ public class TextBlockTest extends AbstractRegressionTest { getCompilerOptions(), new String[] {"--enable-preview"}); } + public void testCompliances_14() { + runConformTest( + new String[] { + "C.java", + "@SuppressWarnings(\"preview\")\n" + + "public class C {\n" + + " public static void main(String argv[]) {\n" + + " String textBlock = \"\"\"\r\n" + + " This is a multi-line\n" + + " message that is super-\n" + + " exciting!\"\"\";\n" + + " System.out.print(compare(textBlock));\n" + + " }\n" + + " private static boolean compare(String textBlock) {\n" + + " String str = \"This is a multi-line\\n\" + \n" + + " \"message that is super-\\n\" + \n" + + " \"exciting!\";\n" + + " return textBlock.equals(str);\n" + + " }\n" + + "}" + }, + "true", + getCompilerOptions(), + new String[] {"--enable-preview"}); + } public void testBug553252() { Map<String, String> defaultOptions = super.getCompilerOptions(); Map<String, String> copy = new HashMap<String, String>(defaultOptions); diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java index 93976092de..2c13259862 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java @@ -587,7 +587,6 @@ protected final boolean scanForTextBlockBeginning() { while (ScannerHelper.isWhitespace(c)) { switch (c) { case 10 : /* \ u000a: LINE FEED */ - case 13 : /* \ u000d: CARRIAGE RETURN */ this.currentCharacter = c; this.currentPosition = temp; return true; |
