RFR: 8183021: Fix failing jshell tests on Windows

Jan Lahoda jan.lahoda at oracle.com
Tue Jun 27 22:05:46 UTC 2017


On 27.6.2017 20:29, Robert Field wrote:
> Looks fine.

Sorry, I was too eager and sent this before the tests were finished. 
Turned out even the snippet.source() may contain "\n". Given the use of 
"\n" seems mostly benign (except for these UI tests), and trying to 
change "\n" to "\r\n" for the snippet.source() seems less safe, I tried 
to fix this solely in the test. Using "[\n]" will translate to "[\r\n]" 
inside the test framework on Windows, which will match the sole \n.

Updated webrev:
http://cr.openjdk.java.net/~jlahoda/8183021/webrev.01/

Sorry for trouble.

>
> We seem to have a general issue of not using platform line ending, I've

I've noticed that, but except for these tests seems mostly benign, right?

Jan

> created:
>
>      https://bugs.openjdk.java.net/browse/JDK-8183022
>
> -Robert
>
> On 06/27/17 10:49, Jan Lahoda wrote:
>> Hi,
>>
>> Two JShell tests are failing on Win:
>> -jdk/jshell/ToolBasicTest.java, seems that
>> System.getProperty("user.home") may return forward slashes, but the
>> tests expects the canonical backward slash. The proposed solution is
>> to normalize the path using Paths.get(...).
>> -jdk/jshell/ToolMultilineSnippetHistoryTest.java, seems JShellTool
>> prints \n, while the test expects \r\n. The proposed solution is to
>> change the relevant place in JShellTool to use println to improve
>> testability.
>>
>> Bug:
>> https://bugs.openjdk.java.net/browse/JDK-8183021
>>
>> Webrev:
>> http://cr.openjdk.java.net/~jlahoda/8183021/webrev.00/
>>
>> Thanks,
>>     Jan
>


More information about the kulla-dev mailing list