mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-12-19 07:00:35 +08:00
Fix absolute max bug (#6144)
This commit is contained in:
@@ -19,4 +19,12 @@ public class AbsoluteMaxTest {
|
||||
void testGetMaxValueWithNoArguments() {
|
||||
assertThrows(IllegalArgumentException.class, AbsoluteMax::getMaxValue);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGetMaxValueWithSameAbsoluteValues() {
|
||||
assertEquals(5, AbsoluteMax.getMaxValue(-5, 5));
|
||||
assertEquals(5, AbsoluteMax.getMaxValue(5, -5));
|
||||
assertEquals(12, AbsoluteMax.getMaxValue(-12, 9, 3, 12, 1));
|
||||
assertEquals(12, AbsoluteMax.getMaxValue(12, 9, 3, -12, 1));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user