style: format code (#4212)

close #4204
This commit is contained in:
acbin
2023-06-09 18:52:05 +08:00
committed by GitHub
parent ad03086f54
commit 00282efd8b
521 changed files with 5233 additions and 7309 deletions

View File

@ -7,26 +7,17 @@ public class GCDTest {
@Test
void test1() {
Assertions.assertThrows(
ArithmeticException.class,
() -> GCD.gcd(-1, 0)
);
Assertions.assertThrows(ArithmeticException.class, () -> GCD.gcd(-1, 0));
}
@Test
void test2() {
Assertions.assertThrows(
ArithmeticException.class,
() -> GCD.gcd(10, -2)
);
Assertions.assertThrows(ArithmeticException.class, () -> GCD.gcd(10, -2));
}
@Test
void test3() {
Assertions.assertThrows(
ArithmeticException.class,
() -> GCD.gcd(-5, -3)
);
Assertions.assertThrows(ArithmeticException.class, () -> GCD.gcd(-5, -3));
}
@Test
@ -48,19 +39,20 @@ public class GCDTest {
void test7() {
Assertions.assertEquals(GCD.gcd(9, 6), 3);
}
@Test
void testArrayGcd1() {
Assertions.assertEquals(GCD.gcd(new int[]{9, 6}), 3);
Assertions.assertEquals(GCD.gcd(new int[] {9, 6}), 3);
}
@Test
void testArrayGcd2() {
Assertions.assertEquals(GCD.gcd(new int[]{2*3*5*7, 2*5*5*5, 2*5*11, 5*5*5*13}), 5);
Assertions.assertEquals(
GCD.gcd(new int[] {2 * 3 * 5 * 7, 2 * 5 * 5 * 5, 2 * 5 * 11, 5 * 5 * 5 * 13}), 5);
}
@Test
void testArrayGcdForEmptyInput() {
Assertions.assertEquals(GCD.gcd(new int[]{}), 0);
}
Assertions.assertEquals(GCD.gcd(new int[] {}), 0);
}
}