style: include UTAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT (#7239)

This commit is contained in:
Piotr Idzik
2026-01-24 14:16:48 +01:00
committed by GitHub
parent 1a7f8fe79e
commit 0b0cefe9f9
23 changed files with 107 additions and 110 deletions

View File

@@ -117,7 +117,7 @@ public class BinarySearch2dArrayTest {
int target = 8;
// Assert that the requirement, that the target is in the middle row and middle column, is
// fulfilled.
assertEquals(arr[arr.length / 2][arr[0].length / 2], target);
assertEquals(target, arr[arr.length / 2][arr[0].length / 2]);
int[] ans = BinarySearch2dArray.binarySearch(arr, target);
System.out.println(Arrays.toString(ans));
assertEquals(1, ans[0]);
@@ -135,8 +135,8 @@ public class BinarySearch2dArrayTest {
// Assert that the requirement, that he target is in the middle column,
// in an array with an even number of columns, and on the row "above" the middle row.
assertEquals(arr[0].length % 2, 0);
assertEquals(arr[arr.length / 2 - 1][arr[0].length / 2], target);
assertEquals(0, arr[0].length % 2);
assertEquals(target, arr[arr.length / 2 - 1][arr[0].length / 2]);
int[] ans = BinarySearch2dArray.binarySearch(arr, target);
System.out.println(Arrays.toString(ans));
assertEquals(0, ans[0]);

View File

@@ -14,7 +14,7 @@ class KMPSearchTest {
KMPSearch kmpSearch = new KMPSearch();
int value = kmpSearch.kmpSearch(pat, txt);
System.out.println(value);
assertEquals(value, 10);
assertEquals(10, value);
}
@Test
@@ -25,7 +25,7 @@ class KMPSearchTest {
KMPSearch kmpSearch = new KMPSearch();
int value = kmpSearch.kmpSearch(pat, txt);
System.out.println(value);
assertEquals(value, 0);
assertEquals(0, value);
}
@Test
@@ -36,7 +36,7 @@ class KMPSearchTest {
KMPSearch kmpSearch = new KMPSearch();
int value = kmpSearch.kmpSearch(pat, txt);
System.out.println(value);
assertEquals(value, 4);
assertEquals(4, value);
}
@Test
@@ -47,7 +47,7 @@ class KMPSearchTest {
KMPSearch kmpSearch = new KMPSearch();
int value = kmpSearch.kmpSearch(pat, txt);
System.out.println(value);
assertEquals(value, 4);
assertEquals(4, value);
}
@Test
@@ -58,6 +58,6 @@ class KMPSearchTest {
KMPSearch kmpSearch = new KMPSearch();
int value = kmpSearch.kmpSearch(pat, txt);
System.out.println(value);
assertEquals(value, -1);
assertEquals(-1, value);
}
}

View File

@@ -172,7 +172,7 @@ class QuickSelectTest {
void quickSelectMedianOfThreeCharacters() {
List<Character> elements = Arrays.asList('X', 'Z', 'Y');
char actual = QuickSelect.select(elements, 1);
assertEquals(actual, 'Y');
assertEquals('Y', actual);
}
@Test