Skip to content

Commit cd5995c

Browse files
authored
style: align layout with clang-format rules
1 parent ddf6ae3 commit cd5995c

1 file changed

Lines changed: 39 additions & 3 deletions

File tree

src/test/java/com/thealgorithms/datastructures/lists/MergeSortedArrayListTest.java

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import java.util.Arrays;
88
import java.util.List;
99
import java.util.stream.Stream;
10-
1110
import org.junit.jupiter.api.Test;
1211
import org.junit.jupiter.params.ParameterizedTest;
1312
import org.junit.jupiter.params.provider.Arguments;
@@ -24,7 +23,44 @@ void testMergeParameterizedScenarios(List<Integer> listA, List<Integer> listB, L
2423
}
2524

2625
private static Stream<Arguments> provideMergeTestData() {
27-
return Stream.of(Arguments.of(Arrays.asList(1, 3, 5, 7, 9), Arrays.asList(2, 4, 6, 8, 10), Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), "Standard alternating sorted lists"), Arguments.of(Arrays.asList(1, 2, 3), new ArrayList<>(), Arrays.asList(1, 2, 3), "Merge with empty second list"), Arguments.of(new ArrayList<>(), Arrays.asList(4, 5, 6), Arrays.asList(4, 5, 6), "Merge with empty first list"), Arguments.of(new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), "Merge with both lists empty"), Arguments.of(Arrays.asList(1, 2, 2, 3), Arrays.asList(2, 3, 4), Arrays.asList(1, 2, 2, 2, 3, 3, 4), "Handling duplicate elements gracefully"), Arguments.of(Arrays.asList(-3, -1, 2), Arrays.asList(-2, 0, 3), Arrays.asList(-3, -2, -1, 0, 2, 3), "Handling negative numbers mixed with positive numbers"));
26+
return Stream.of(
27+
Arguments.of(
28+
Arrays.asList(1, 3, 5, 7, 9),
29+
Arrays.asList(2, 4, 6, 8, 10),
30+
Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
31+
"Standard alternating sorted lists"
32+
),
33+
Arguments.of(
34+
Arrays.asList(1, 2, 3),
35+
new ArrayList<>(),
36+
Arrays.asList(1, 2, 3),
37+
"Merge with empty second list"
38+
),
39+
Arguments.of(
40+
new ArrayList<>(),
41+
Arrays.asList(4, 5, 6),
42+
Arrays.asList(4, 5, 6),
43+
"Merge with empty first list"
44+
),
45+
Arguments.of(
46+
new ArrayList<>(),
47+
new ArrayList<>(),
48+
new ArrayList<>(),
49+
"Merge with both lists empty"
50+
),
51+
Arguments.of(
52+
Arrays.asList(1, 2, 2, 3),
53+
Arrays.asList(2, 3, 4),
54+
Arrays.asList(1, 2, 2, 2, 3, 3, 4),
55+
"Handling duplicate elements gracefully"
56+
),
57+
Arguments.of(
58+
Arrays.asList(-3, -1, 2),
59+
Arrays.asList(-2, 0, 3),
60+
Arrays.asList(-3, -2, -1, 0, 2, 3),
61+
"Handling negative numbers mixed with positive numbers"
62+
)
63+
);
2864
}
2965

3066
@Test
@@ -47,4 +83,4 @@ void testMergeThrowsExceptionWhenResultCollectionIsNull() {
4783
List<Integer> listB = Arrays.asList(4, 5, 6);
4884
assertThrows(NullPointerException.class, () -> MergeSortedArrayList.merge(listA, listB, null));
4985
}
50-
}
86+
}

0 commit comments

Comments
 (0)