From 4e7843b80121798da6c5dc3438b0a1737c08ef6d Mon Sep 17 00:00:00 2001 From: varunu28 Date: Sat, 8 Sep 2018 08:21:27 -0700 Subject: [PATCH] Corrected the InsertionSort test --- .gitignore | 2 +- src/test/java/com/sorts/InsertionSortTest.java | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index a19e87bd..c2e8de74 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ Java.iml .idea/* out/ -Downloads.iml +*.iml diff --git a/src/test/java/com/sorts/InsertionSortTest.java b/src/test/java/com/sorts/InsertionSortTest.java index 0d35f571..1dcc6fef 100644 --- a/src/test/java/com/sorts/InsertionSortTest.java +++ b/src/test/java/com/sorts/InsertionSortTest.java @@ -15,16 +15,16 @@ public class InsertionSortTest { Integer[] sortedInt = new Integer[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; Assert.assertArrayEquals(sortedInt, insertionSort.sort(unsortedInt)); - Integer[] unsortedInt = new Integer[]{5,4,3,2,1,0}; - Integer[] sortedInt = new Integer[]{0, 1, 2, 3, 4, 5}; + unsortedInt = new Integer[]{5,4,3,2,1,0}; + sortedInt = new Integer[]{0, 1, 2, 3, 4, 5}; Assert.assertArrayEquals(sortedInt, insertionSort.sort(unsortedInt)); - Integer[] unsortedInt = new Integer[]{-1,-2,-3,-4,-5}; - Integer[] sortedInt = new Integer[]{-5,-4,-3,-2,-1}; + unsortedInt = new Integer[]{-1,-2,-3,-4,-5}; + sortedInt = new Integer[]{-5,-4,-3,-2,-1}; Assert.assertArrayEquals(sortedInt, insertionSort.sort(unsortedInt)); - Integer[] unsortedInt = new Integer[]{-1,-5,-10,-990,990,1010}; - Integer[] sortedInt = new Integer[]{-990,-10,-5,-1,990,1010}; + unsortedInt = new Integer[]{-1,-5,-10,-990,990,1010}; + sortedInt = new Integer[]{-990,-10,-5,-1,990,1010}; Assert.assertArrayEquals(sortedInt, insertionSort.sort(unsortedInt)); Character[] unsortedChar = new Character[]{'f', 'h', 'c', 'a', 'b', 'd', 'g', 'e'};