mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-28 23:15:17 +08:00
chore: enforce InsertNewlineAtEOF
in clang-format
(#4343)
* style: insert newline at eof * style: use `InsertNewlineAtEOF` in `clang-format` * fix: use `clang-format-16` * chore: update clang-format-lint-action to v0.16.2 --------- Co-authored-by: Debasish Biswas <debasishbsws.dev@gmail.com>
This commit is contained in:
@ -54,4 +54,4 @@ public class AllPathsFromSourceToTargetTest {
|
||||
list2 = list1;
|
||||
assertIterableEquals(list1, list2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,4 +29,4 @@ public class WordSearchTest {
|
||||
String word = "ABCB";
|
||||
Assertions.assertFalse(ws.exist(board, word));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,4 +17,4 @@ class IndexOfRightMostSetBitTest {
|
||||
assertEquals(-1, IndexOfRightMostSetBit.indexOfRightMostSetBit(0));
|
||||
assertEquals(3, IndexOfRightMostSetBit.indexOfRightMostSetBit(-40));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,4 +20,4 @@ class NonRepeatingNumberFinderTest {
|
||||
int arr2[] = {12};
|
||||
assertEquals(12, NonRepeatingNumberFinder.findNonRepeatingNumber(arr2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,4 +30,4 @@ class NumbersDifferentSignsTest {
|
||||
void testSameSignsNegative() {
|
||||
assertFalse(NumbersDifferentSigns.differentSigns(-5, -8));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,4 +30,4 @@ public class BinaryToDecimalTest {
|
||||
assertEquals(262144L, BinaryToDecimal.binaryToDecimal(1000000000000000000L));
|
||||
assertEquals(524287L, BinaryToDecimal.binaryToDecimal(1111111111111111111L));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,4 +25,4 @@ public class LeftistHeapTest {
|
||||
heap.clear();
|
||||
Assertions.assertTrue(heap.isEmpty());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,4 +23,4 @@ class LinkedQueueTest {
|
||||
if (element[0]++ != integer) throw new AssertionError();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,4 +37,4 @@ class StrassenMatrixMultiplicationTest {
|
||||
int[][] actResult = SMM.multiply(A, B);
|
||||
assertArrayEquals(expResult, actResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,4 +31,4 @@ public class KnapsackMemoizationTest {
|
||||
int capacity = 50;
|
||||
assertEquals(220, knapsackMemoization.knapSack(capacity, weight, value, weight.length));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -95,4 +95,4 @@ public class OptimalJobSchedulingTest {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,4 +21,4 @@ class PartitionProblemTest {
|
||||
public void testIfSumOfTheArrayIsEven2() {
|
||||
assertFalse(PartitionProblem.partition(new int[] {1, 2, 3, 8}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,4 +13,4 @@ public class GrahamScanTest {
|
||||
GrahamScan graham = new GrahamScan(points);
|
||||
assertEquals(expectedResult, graham.hull().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -98,4 +98,4 @@ class AreaTest {
|
||||
-> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaCircle(0)),
|
||||
() -> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaHemisphere(0)), () -> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaCone(1, 0)), () -> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaCone(0, 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,4 +14,4 @@ class DudeneyNumberTest {
|
||||
assertTrue(() -> DudeneyNumber.isDudeney(validDudeneyNumber));
|
||||
assertFalse(() -> DudeneyNumber.isDudeney(invalidDudeneyNumber));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,4 +17,4 @@ class PowerUsingRecursionTest {
|
||||
assertEquals(97.65625, PowerUsingRecursion.power(2.5, 5));
|
||||
assertEquals(81, PowerUsingRecursion.power(3, 4));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,4 +13,4 @@ class CountCharTest {
|
||||
|
||||
assertEquals(expectedValue, CountChar.CountCharacters(input));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,4 +29,4 @@ class PreemptivePrioritySchedulingTest {
|
||||
// Assert
|
||||
assertEquals(expectedGanttChart, actualGanttChart);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -60,4 +60,4 @@ class RRSchedulingTest {
|
||||
|
||||
return processDetails;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -106,4 +106,4 @@ class SJFSchedulingTest {
|
||||
a.scheduleProcesses();
|
||||
assertTrue(a.schedule.isEmpty());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,4 +99,4 @@ public class BreadthFirstSearchTest {
|
||||
// check path is the whole list
|
||||
assertArrayEquals(expectedPath.toArray(), bfs.getVisited().toArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,4 +23,4 @@ public class sortOrderAgnosticBinarySearchTest {
|
||||
int excepted = 3;
|
||||
assertEquals(excepted, ans);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,4 +39,4 @@ public class BeadSortTest {
|
||||
int[] expectedOutput = {1, 6, 15, 23, 23, 27, 27, 36};
|
||||
assertArrayEquals(outputArray, expectedOutput);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,4 +45,4 @@ public class BucketSortTest {
|
||||
int[] expectedOutput = {-36, -15, -1, 6, 23, 23, 27, 27};
|
||||
assertArrayEquals(outputArray, expectedOutput);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -59,4 +59,4 @@ class DualPivotQuickSortTest {
|
||||
String[] expected = {"ant", "apple", "boss", "cat", "dog", "eat"};
|
||||
assertArrayEquals(expected, sorted);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -83,4 +83,4 @@ class HorspoolSearchTest {
|
||||
void testFindFirstTextNull() {
|
||||
assertThrows(NullPointerException.class, () -> HorspoolSearch.findFirst("Hello", null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user