Skip to content

Commit 853d2e4

Browse files
author
pushkar
committed
Formatted the newly added tests using clang-format
1 parent 77bd121 commit 853d2e4

File tree

6 files changed

+41
-47
lines changed

6 files changed

+41
-47
lines changed

src/test/java/com/thealgorithms/sorts/AdaptiveMergeSortTest.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
44

5-
import org.junit.jupiter.api.Test;
6-
75
import java.util.Objects;
6+
import org.junit.jupiter.api.Test;
87

98
public class AdaptiveMergeSortTest {
109

@@ -123,14 +122,14 @@ public int hashCode() {
123122
public void testSortCustomObjects() {
124123
AdaptiveMergeSort adaptiveMergeSort = new AdaptiveMergeSort();
125124
Person[] inputArray = {
126-
new Person("Alice", 32),
127-
new Person("Bob", 25),
128-
new Person("Charlie", 28),
125+
new Person("Alice", 32),
126+
new Person("Bob", 25),
127+
new Person("Charlie", 28),
129128
};
130129
Person[] expectedOutput = {
131-
new Person("Bob", 25),
132-
new Person("Charlie", 28),
133-
new Person("Alice", 32),
130+
new Person("Bob", 25),
131+
new Person("Charlie", 28),
132+
new Person("Alice", 32),
134133
};
135134
Person[] outputArray = adaptiveMergeSort.sort(inputArray);
136135
assertArrayEquals(expectedOutput, outputArray);

src/test/java/com/thealgorithms/sorts/BogoSortTest.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
44

5-
import org.junit.jupiter.api.Test;
6-
75
import java.util.Objects;
6+
import org.junit.jupiter.api.Test;
87

98
public class BogoSortTest {
109

@@ -131,14 +130,14 @@ public int hashCode() {
131130
@Test
132131
public void bogoSortCustomObjects() {
133132
Person[] inputArray = {
134-
new Person("Alice", 32),
135-
new Person("Bob", 25),
136-
new Person("Charlie", 28),
133+
new Person("Alice", 32),
134+
new Person("Bob", 25),
135+
new Person("Charlie", 28),
137136
};
138137
Person[] expectedOutput = {
139-
new Person("Bob", 25),
140-
new Person("Charlie", 28),
141-
new Person("Alice", 32),
138+
new Person("Bob", 25),
139+
new Person("Charlie", 28),
140+
new Person("Alice", 32),
142141
};
143142
Person[] outputArray = bogoSort.sort(inputArray);
144143
assertArrayEquals(expectedOutput, outputArray);

src/test/java/com/thealgorithms/sorts/BubbleSortTest.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
44

5-
import org.junit.jupiter.api.Test;
6-
75
import java.util.Objects;
6+
import org.junit.jupiter.api.Test;
87

98
/**
109
* @author Aitor Fidalgo (https://github.com/aitorfi)
@@ -159,17 +158,16 @@ public int hashCode() {
159158
@Test
160159
public void bubbleSortCustomObjects() {
161160
Person[] inputArray = {
162-
new Person("Alice", 32),
163-
new Person("Bob", 25),
164-
new Person("Charlie", 28),
161+
new Person("Alice", 32),
162+
new Person("Bob", 25),
163+
new Person("Charlie", 28),
165164
};
166165
Person[] expectedOutput = {
167-
new Person("Bob", 25),
168-
new Person("Charlie", 28),
169-
new Person("Alice", 32),
166+
new Person("Bob", 25),
167+
new Person("Charlie", 28),
168+
new Person("Alice", 32),
170169
};
171170
Person[] outputArray = bubbleSort.sort(inputArray);
172171
assertArrayEquals(expectedOutput, outputArray);
173172
}
174-
175173
}

src/test/java/com/thealgorithms/sorts/GnomeSortTest.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
import static org.assertj.core.api.Assertions.assertThat;
44
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
55

6+
import java.util.Objects;
67
import org.junit.jupiter.api.DisplayName;
78
import org.junit.jupiter.api.Test;
89

9-
import java.util.Objects;
10-
1110
public class GnomeSortTest {
1211

1312
private GnomeSort gnomeSort = new GnomeSort();
@@ -153,14 +152,14 @@ public int hashCode() {
153152
@DisplayName("GnomeSort Custom Object Array")
154153
public void testSortCustomObjects() {
155154
Person[] inputArray = {
156-
new Person("Alice", 32),
157-
new Person("Bob", 25),
158-
new Person("Charlie", 28),
155+
new Person("Alice", 32),
156+
new Person("Bob", 25),
157+
new Person("Charlie", 28),
159158
};
160159
Person[] expectedOutput = {
161-
new Person("Bob", 25),
162-
new Person("Charlie", 28),
163-
new Person("Alice", 32),
160+
new Person("Bob", 25),
161+
new Person("Charlie", 28),
162+
new Person("Alice", 32),
164163
};
165164
Person[] outputArray = gnomeSort.sort(inputArray);
166165
assertArrayEquals(expectedOutput, outputArray);

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ public int hashCode() {
179179
@Test
180180
public void testSortCustomObjects() {
181181
Person[] inputArray = {
182-
new Person("Alice", 32),
183-
new Person("Bob", 25),
184-
new Person("Charlie", 28),
182+
new Person("Alice", 32),
183+
new Person("Bob", 25),
184+
new Person("Charlie", 28),
185185
};
186186
Person[] expectedOutput = {
187-
new Person("Bob", 25),
188-
new Person("Charlie", 28),
189-
new Person("Alice", 32),
187+
new Person("Bob", 25),
188+
new Person("Charlie", 28),
189+
new Person("Alice", 32),
190190
};
191191
Person[] outputArray = insertionSort.sort(inputArray);
192192
assertArrayEquals(expectedOutput, outputArray);

src/test/java/com/thealgorithms/sorts/SlowSortTest.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
44

5-
import org.junit.jupiter.api.Test;
6-
75
import java.util.Objects;
6+
import org.junit.jupiter.api.Test;
87

98
/**
109
* @author Rebecca Velez (https://github.com/rebeccavelez)
@@ -144,14 +143,14 @@ public int hashCode() {
144143
@Test
145144
public void testSortCustomObjects() {
146145
Person[] inputArray = {
147-
new Person("Alice", 32),
148-
new Person("Bob", 25),
149-
new Person("Charlie", 28),
146+
new Person("Alice", 32),
147+
new Person("Bob", 25),
148+
new Person("Charlie", 28),
150149
};
151150
Person[] expectedOutput = {
152-
new Person("Bob", 25),
153-
new Person("Charlie", 28),
154-
new Person("Alice", 32),
151+
new Person("Bob", 25),
152+
new Person("Charlie", 28),
153+
new Person("Alice", 32),
155154
};
156155
Person[] outputArray = slowSort.sort(inputArray);
157156
assertArrayEquals(expectedOutput, outputArray);

0 commit comments

Comments
 (0)