On Tue, 13 Feb 2024 07:21:01 GMT, Alan Bateman <al...@openjdk.org> wrote:

>> Roger Riggs has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Test Files.readString with multiple charsets
>>   Cleanup regression test to match style of other tests
>
> test/jdk/java/nio/file/Files/ReadWriteString.java line 322:
> 
>> 320:         }
>> 321:         assertEquals(actual, original, "Round trip string mismatch with 
>> multi-byte encoding");
>> 322:     }
> 
> The update to newStringNoRepl1 looks fine.
> 
> The added test is very different to the tests in this source file. We really 
> need to expand the test to exercise a lot more charsets and input cases.  
> It's okay to have a targeted test for now but needs to be renamed to be 
> consistent with the other tests. Also the other tests use testFiles as the 
> file paths rather than putting files in /tmp.

The UTF-16 charset is added to the existing `readString` test.
Additional charsets can be added, most will exercise the same code path in 
newStringNoRepl1 that uses a CharsetDecoder for all charsets other than UTF-8, 
ASCII, or ISO-8859-1.

The additional individual test is taken from the bug report and is not strictly 
necessary.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17817#discussion_r1487787125

Reply via email to