On Fri, 2 May 2025 22:04:15 GMT, Roger Riggs <[email protected]> wrote:
>> On the other hand, the test can be modified as follows: on Windows, pass an
>> empty string as an argument to `echo` and expect two double quotes followed
>> by a newline character as the valid result:
>>
>>
>> String[] cmdp = Windows.is() ? new String[]{"cmd.exe", "/c", "echo", ""} :
>> new String[]{"echo"};
>> String[] envp = {"Hello", "World"}; // Yuck!
>> Process p = Runtime.getRuntime().exec(cmdp, envp);
>> String expected = Windows.is() ? """\n" : "\n";
>> equal(commandOutput(p), expected);
>>
>>
>> What do you prefer: the "echo/" variant or the "double quotes" variant?
>
> I'd use the 'echo/' version to keep the test simpler.
done: 61ab85f2cff6d35ba53f7538dcbca95e46d541cd
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23933#discussion_r2072379429