changeset 3321:68696e640592

8153482: jdk/jshell/StartOptionTest.java fails on Windows after JDK-8147515 Reviewed-by: jlahoda
author rfield
date Tue, 05 Apr 2016 00:46:51 -0700
parents f2ce02ef81e9
children d5754aaff8ec
files test/jdk/jshell/StartOptionTest.java
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/test/jdk/jshell/StartOptionTest.java	Mon Apr 04 20:28:05 2016 -0700
+++ b/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);
         }
     }