From 820a5618c4f5e59b03d422bd0e81fa53421aae81 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Thu, 21 Jun 2018 14:33:15 -0700 Subject: [PATCH] 8205442: Avoid hard-coding --source value in SourceLauncherTest.java Reviewed-by: darcy --- .../tools/javac/launcher/SourceLauncherTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/langtools/tools/javac/launcher/SourceLauncherTest.java b/test/langtools/tools/javac/launcher/SourceLauncherTest.java index d67e7d15927..708bed2ed03 100644 --- a/test/langtools/tools/javac/launcher/SourceLauncherTest.java +++ b/test/langtools/tools/javac/launcher/SourceLauncherTest.java @@ -121,7 +121,7 @@ public class SourceLauncherTest extends TestRunner { @Test public void testHelloWorldWithShebang(Path base) throws IOException { tb.writeJavaFiles(base, - "#!/usr/bin/java --source 11\n" + + "#!/usr/bin/java --source " + thisVersion + "\n" + "import java.util.Arrays;\n" + "class HelloWorld {\n" + " public static void main(String... args) {\n" + @@ -205,7 +205,7 @@ public class SourceLauncherTest extends TestRunner { @Test public void testHelloWorldWithShebangJava(Path base) throws IOException { tb.writeJavaFiles(base, - "#!/usr/bin/java --source 11\n" + + "#!/usr/bin/java --source " + thisVersion + "\n" + "import java.util.Arrays;\n" + "class HelloWorld {\n" + " public static void main(String... args) {\n" + @@ -215,10 +215,10 @@ public class SourceLauncherTest extends TestRunner { Path file = base.resolve("HelloWorld.java"); testError(file, file + ":1: error: illegal character: '#'\n" + - "#!/usr/bin/java --source 11\n" + + "#!/usr/bin/java --source " + thisVersion + "\n" + "^\n" + file + ":1: error: class, interface, or enum expected\n" + - "#!/usr/bin/java --source 11\n" + + "#!/usr/bin/java --source " + thisVersion + "\n" + " ^\n" + "2 errors\n", "error: compilation failed"); @@ -305,7 +305,7 @@ public class SourceLauncherTest extends TestRunner { @Test public void testBadShebang(Path base) throws IOException { tb.writeJavaFiles(base, - "#/usr/bin/java --source 11\n" + + "#/usr/bin/java --source " + thisVersion + "\n" + "import java.util.Arrays;\n" + "class HelloWorld {\n" + " public static void main(String... args) {\n" + @@ -315,10 +315,10 @@ public class SourceLauncherTest extends TestRunner { Path file = base.resolve("HelloWorld.java"); testError(file, file + ":1: error: illegal character: '#'\n" + - "#/usr/bin/java --source 11\n" + + "#/usr/bin/java --source " + thisVersion + "\n" + "^\n" + file + ":1: error: class, interface, or enum expected\n" + - "#/usr/bin/java --source 11\n" + + "#/usr/bin/java --source " + thisVersion + "\n" + " ^\n" + "2 errors\n", "error: compilation failed");