Skip to content

Commit 354e37c

Browse files
committed
Add missing test for UnsynchronizedBufferedReader.skip(int)
1 parent 443f21d commit 354e37c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/test/java/org/apache/commons/io/input/UnsynchronizedBufferedReaderTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,4 +622,15 @@ void testSkip() throws IOException {
622622
br.read(buf, 0, 500);
623623
assertTrue(testString.substring(500, 1000).equals(new String(buf, 0, 500)));
624624
}
625+
626+
/**
627+
* Tests {@link UnsynchronizedBufferedReader#skip(int)}.
628+
*
629+
* @throws IOException test failure.
630+
*/
631+
@Test
632+
void testSkipIllegal() throws IOException {
633+
br = new UnsynchronizedBufferedReader(new StringReader(testString));
634+
assertThrows(IllegalArgumentException.class, () -> br.skip(-1));
635+
}
625636
}

0 commit comments

Comments
 (0)