Skip to content

Commit 62d7870

Browse files
committed
Fix SleepSort test to use standard SortingAlgorithmTest
- Replace custom test with standard framework - Ensures compatibility with all test scenarios - Fixes CI test failures
1 parent 6d0c9ae commit 62d7870

File tree

1 file changed

+4
-28
lines changed

1 file changed

+4
-28
lines changed
Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,8 @@
11
package com.thealgorithms.sorts;
22

3-
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
4-
5-
import org.junit.jupiter.api.Test;
6-
7-
public class SleepSortTest {
8-
9-
@Test
10-
void testSleepSort() {
11-
int[] input = {5, 3, 6, 2, 10};
12-
int[] expected = {2, 3, 5, 6, 10};
13-
int[] result = SleepSort.sort(input);
14-
assertArrayEquals(expected, result);
15-
}
16-
17-
@Test
18-
void testEmptyArray() {
19-
int[] input = {};
20-
int[] expected = {};
21-
int[] result = SleepSort.sort(input);
22-
assertArrayEquals(expected, result);
23-
}
24-
25-
@Test
26-
void testSingleElement() {
27-
int[] input = {42};
28-
int[] expected = {42};
29-
int[] result = SleepSort.sort(input);
30-
assertArrayEquals(expected, result);
3+
public class SleepSortTest extends SortingAlgorithmTest {
4+
@Override
5+
SortAlgorithm getSortAlgorithm() {
6+
return new SleepSort();
317
}
328
}

0 commit comments

Comments
 (0)