kinow commented on code in PR #374:
URL: https://github.com/apache/commons-io/pull/374#discussion_r953251934
##########
src/test/java/org/apache/commons/io/IOUtilsTest.java:
##########
@@ -1716,4 +1716,18 @@ public void testWriteLittleString() throws IOException {
}
}
+ @Test
+ public void testByteArrayWithIllegalSize() {
+ try {
+ int size = -1;
+ byte[] bytes = IOUtils.byteArray(size);
+
+ size = 0;
+ bytes = IOUtils.byteArray(size);
+ }catch (Exception e) {
+ assertEquals(e.getClass().getName(),
IllegalArgumentException.class.getName());
+ }
Review Comment:
And I think when the first exception happens, the second is part of the test
is never executed? Probably needs to be broken down into two separate tests,
maybe with `@ParameterizedTest` too.
--
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]