You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/07/07 20:24:20 UTC
(commons-io) 03/08: Add ClosedInputStreamTest#testAvailable()
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git
commit 2432b1b35e9b564b27e80ac06930346bac50a56e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jul 7 14:14:58 2024 -0400
Add ClosedInputStreamTest#testAvailable()
---
.../java/org/apache/commons/io/input/ClosedInputStreamTest.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/test/java/org/apache/commons/io/input/ClosedInputStreamTest.java b/src/test/java/org/apache/commons/io/input/ClosedInputStreamTest.java
index 6ad00f7d2..76b48d9f3 100644
--- a/src/test/java/org/apache/commons/io/input/ClosedInputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/input/ClosedInputStreamTest.java
@@ -31,6 +31,15 @@ public class ClosedInputStreamTest {
assertEquals(EOF, cis.read(), "read()");
}
+ @Test
+ public void testAvailable() throws Exception {
+ assertEquals(0, ClosedInputStream.INSTANCE.available());
+ assertEquals(0, ClosedInputStream.INSTANCE.available());
+ try (ClosedInputStream cis = new ClosedInputStream()) {
+ assertEquals(0, cis.available());
+ }
+ }
+
@SuppressWarnings("resource")
@Test
public void testNonNull() throws Exception {