File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
src/test/java/br/com/zevolution/algorithms/sorting Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 33import static br .com .zevolution .algorithms .sorting .SortingTestData .*;
44import static org .junit .Assert .*;
55
6+ import java .util .Arrays ;
7+
68public class SortTester {
79
810 public static void testSort (Sort sorter ) {
911 assertArrayEquals (SORTED_BY_LOWEST_PRICE , sorter .sort (SORTED_BY_HIGHEST_PRICE , SORTED_BY_HIGHEST_PRICE .length ));
1012 assertArrayEquals (SORTED_BY_LOWEST_PRICE , sorter .sort (SORTED_BY_LOWEST_PRICE , SORTED_BY_LOWEST_PRICE .length ));
1113 assertArrayEquals (SORTED_BY_LOWEST_PRICE , sorter .sort (NOT_SORTED , NOT_SORTED .length ));
1214 assertArrayEquals (SAME_PRODUCT , sorter .sort (SAME_PRODUCT , SAME_PRODUCT .length ));
15+
16+ // Make sure which original array it's not modified
17+ sorter .sort (NOT_SORTED , NOT_SORTED .length );
18+ assertFalse (Arrays .equals (SORTED_BY_LOWEST_PRICE , NOT_SORTED ));
1319 }
1420
1521}
You can’t perform that action at this time.
0 commit comments