garydgregory commented on code in PR #1506:
URL: https://github.com/apache/commons-lang/pull/1506#discussion_r2571481828
##########
src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java:
##########
@@ -1205,35 +1205,31 @@ void testMaxByte_nullArray() {
@Test
void testMaxDouble() {
- final double[] d = null;
- assertNullPointerException(() -> NumberUtils.max(d), "No exception was
thrown for null input.");
-
- assertIllegalArgumentException(NumberUtils::max, "No exception was
thrown for empty input.");
-
- assertEquals(5.1f, NumberUtils.max(5.1f), "max(double[]) failed for
array length 1");
- assertEquals(9.2f, NumberUtils.max(6.3f, 9.2f), "max(double[]) failed
for array length 2");
- assertEquals(10.4f, NumberUtils.max(-10.5f, -5.6f, 0, 5.7f, 10.4f),
"max(double[]) failed for float length 5");
- assertEquals(10, NumberUtils.max(-10, -5, 0, 5, 10), 0.0001);
- assertEquals(10, NumberUtils.max(-5, 0, 10, 5, -10), 0.0001);
+ assertEquals(5.1d, NumberUtils.max(5.1d), "max(double[]) failed for
array length 1");
+ assertEquals(9.2d, NumberUtils.max(6.3d, 9.2d), "max(double[]) failed
for array length 2");
+ assertEquals(10.4d, NumberUtils.max(-10.5d, -5.6d, 0, 5.7d, 10.4d),
"max(double[]) failed for double length 5");
+ assertEquals(10d, NumberUtils.max(-10d, -5d, 0d, 5d, 10d));
+ assertEquals(10d, NumberUtils.max(-5d, 0d, 10d, 5d, -10d));
}
@Test
void testMaxDouble_emptyArray() {
- assertIllegalArgumentException(NumberUtils::max);
+ final double[] d = new double[0];
+ assertIllegalArgumentException(() -> NumberUtils.max(d), "No exception
was thrown for empty input.");
}
@Test
void testMaxDouble_nullArray() {
- assertNullPointerException(() -> NumberUtils.max((double[]) null));
+ assertNullPointerException(() -> NumberUtils.max((double[]) null), "No
exception was thrown for null input.");
Review Comment:
No need for this extra message IMO, it doesn't help more than the actual
assert.
--
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]