Skip to content

Commit 4e7843b

Browse files
committed
Corrected the InsertionSort test
1 parent c4a13fc commit 4e7843b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Java.iml
22
.idea/*
33
out/
4-
Downloads.iml
4+
*.iml

src/test/java/com/sorts/InsertionSortTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ public void insertionSortTest() {
1515
Integer[] sortedInt = new Integer[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
1616
Assert.assertArrayEquals(sortedInt, insertionSort.sort(unsortedInt));
1717

18-
Integer[] unsortedInt = new Integer[]{5,4,3,2,1,0};
19-
Integer[] sortedInt = new Integer[]{0, 1, 2, 3, 4, 5};
18+
unsortedInt = new Integer[]{5,4,3,2,1,0};
19+
sortedInt = new Integer[]{0, 1, 2, 3, 4, 5};
2020
Assert.assertArrayEquals(sortedInt, insertionSort.sort(unsortedInt));
2121

22-
Integer[] unsortedInt = new Integer[]{-1,-2,-3,-4,-5};
23-
Integer[] sortedInt = new Integer[]{-5,-4,-3,-2,-1};
22+
unsortedInt = new Integer[]{-1,-2,-3,-4,-5};
23+
sortedInt = new Integer[]{-5,-4,-3,-2,-1};
2424
Assert.assertArrayEquals(sortedInt, insertionSort.sort(unsortedInt));
2525

26-
Integer[] unsortedInt = new Integer[]{-1,-5,-10,-990,990,1010};
27-
Integer[] sortedInt = new Integer[]{-990,-10,-5,-1,990,1010};
26+
unsortedInt = new Integer[]{-1,-5,-10,-990,990,1010};
27+
sortedInt = new Integer[]{-990,-10,-5,-1,990,1010};
2828
Assert.assertArrayEquals(sortedInt, insertionSort.sort(unsortedInt));
2929

3030
Character[] unsortedChar = new Character[]{'f', 'h', 'c', 'a', 'b', 'd', 'g', 'e'};

0 commit comments

Comments
 (0)