qwerty4030 commented on code in PR #758:
URL: https://github.com/apache/commons-io/pull/758#discussion_r2182026306
##########
src/test/java/org/apache/commons/io/output/ByteArrayOutputStreamTest.java:
##########
@@ -198,7 +205,23 @@ void testToBufferedInputStreamEmpty(final String baosName,
final IOFunction<Inpu
try (InputStream buffered =
toBufferedInputStreamFunction.apply(bain)) {
assertEquals(0, buffered.available());
+ }
+ }
+ }
+
+ @ParameterizedTest(name = "[{index}] {0}")
+ @MethodSource("toBufferedInputStreamFunctionFactories")
+ void testToBufferedInputStreamEmptyFile(final String baosName, final
IOFunction<InputStream, InputStream> toBufferedInputStreamFunction,
+ final @TempDir Path
temporaryFolder) throws IOException {
+ final Path emptyFile = Files.createTempFile(temporaryFolder,
getClass().getSimpleName(), "-empty.txt");
+
+ try (InputStream is = Files.newInputStream(emptyFile)) {
Review Comment:
interesting corner case if you have an empty `ByteArrayInputStream` and you
call `read` with a 0 size buffer it will return `EOF` BUT if you have an empty
`FileInputStream` in that same scenario it will return 0.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]