style: resolve some of the UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS warnings (#7240)

This commit is contained in:
Piotr Idzik
2026-01-25 12:44:41 +01:00
committed by GitHub
parent 0b0cefe9f9
commit 6fdf2db298
3 changed files with 7 additions and 6 deletions

View File

@@ -28,16 +28,16 @@ public class CombinationTest {
@Test
void testLengthOne() {
List<TreeSet<Integer>> result = Combination.combination(new Integer[] {1, 2}, 1);
assertTrue(result.get(0).iterator().next() == 1);
assertTrue(result.get(1).iterator().next() == 2);
assertEquals(1, result.get(0).iterator().next());
assertEquals(2, result.get(1).iterator().next());
}
@Test
void testLengthTwo() {
List<TreeSet<Integer>> result = Combination.combination(new Integer[] {1, 2}, 2);
Integer[] arr = result.get(0).toArray(new Integer[2]);
assertTrue(arr[0] == 1);
assertTrue(arr[1] == 2);
assertEquals(1, arr[0]);
assertEquals(2, arr[1]);
}
@Test

View File

@@ -1,6 +1,7 @@
package com.thealgorithms.misc;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -67,7 +68,7 @@ public class ShuffleArrayTest {
ShuffleArray.shuffle(arr);
// Check that the shuffled array contains the same elements
assertTrue(arr.length == 5);
assertEquals(5, arr.length);
for (int i = 1; i <= 5; i++) {
assertTrue(contains(arr, i));
}

View File

@@ -17,7 +17,7 @@ public class PasswordGenTest {
@Test
public void generateOneCharacterPassword() {
String tempPassword = PasswordGen.generatePassword(1, 2);
assertTrue(tempPassword.length() == 1);
assertEquals(1, tempPassword.length());
}
@Test