8153482: jdk/jshell/StartOptionTest.java fails on Windows after JDK-8147515
authorrfield
Tue, 05 Apr 2016 00:46:51 -0700
changeset 36993 e00f4be3a47d
parent 36992 ddebebe611a1
child 36994 b6fede3120ae
8153482: jdk/jshell/StartOptionTest.java fails on Windows after JDK-8147515 Reviewed-by: jlahoda
langtools/test/jdk/jshell/StartOptionTest.java
--- a/langtools/test/jdk/jshell/StartOptionTest.java	Mon Apr 04 20:28:05 2016 -0700
+++ b/langtools/test/jdk/jshell/StartOptionTest.java	Tue Apr 05 00:46:51 2016 -0700
@@ -88,7 +88,7 @@
     }
 
     private void start(String expectedOutput, String expectedError, String... args) throws Exception {
-        start(s -> assertEquals(s, expectedOutput, "Output: "), s -> assertEquals(s, expectedError, "Error: "), args);
+        start(s -> assertEquals(s.trim(), expectedOutput, "Output: "), s -> assertEquals(s.trim(), expectedError, "Error: "), args);
     }
 
     @BeforeMethod
@@ -110,7 +110,7 @@
         start(s -> {
             assertTrue(s.split("\n").length >= 7, s);
             assertTrue(s.startsWith("Usage:   jshell <options>"), s);
-        }, s -> assertEquals(s, "Unknown option: -unknown\n"), "-unknown");
+        }, s -> assertEquals(s.trim(), "Unknown option: -unknown"), "-unknown");
     }
 
     @Test(enabled = false) // TODO 8080883
@@ -118,17 +118,17 @@
         Compiler compiler = new Compiler();
         Path p = compiler.getPath("file.txt");
         compiler.writeToFile(p);
-        start("", "'-startup' requires a filename argument.\n", "-startup");
-        start("", "Conflicting -startup or -nostartup option.\n", "-startup", p.toString(), "-startup", p.toString());
-        start("", "Conflicting -startup or -nostartup option.\n", "-nostartup", "-startup", p.toString());
-        start("", "Conflicting -startup or -nostartup option.\n", "-startup", p.toString(), "-nostartup");
+        start("", "'-startup' requires a filename argument.", "-startup");
+        start("", "Conflicting -startup or -nostartup option.", "-startup", p.toString(), "-startup", p.toString());
+        start("", "Conflicting -startup or -nostartup option.", "-nostartup", "-startup", p.toString());
+        start("", "Conflicting -startup or -nostartup option.", "-startup", p.toString(), "-nostartup");
     }
 
     @Test
     public void testClasspath() throws Exception {
         for (String cp : new String[] {"-cp", "-classpath"}) {
-            start("", "Conflicting -classpath option.\n", cp, ".", "-classpath", ".");
-            start("", "Argument to -classpath missing.\n", cp);
+            start("", "Conflicting -classpath option.", cp, ".", "-classpath", ".");
+            start("", "Argument to -classpath missing.", cp);
         }
     }