Last active
August 29, 2015 14:04
-
-
Save sadv1r/1ff76b3d976d8483251c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ru.sadv1r.study.core.array; | |
import org.junit.*; | |
import static org.junit.Assert.*; | |
/** | |
* Created by IntelliJ IDEA. | |
* User: Sadv1r | |
* Date: 7/24/14 | |
* Time: 10:35 | |
*/ | |
public class MergerTest { | |
@Test | |
public void mergerDangerousArrays() { | |
Merger merger = new Merger(); | |
/** | |
* Меррон, твое любимое: | |
* / | |
int[][][] dataArrays = { | |
{{}, {}, {}}, | |
{{0}, {}, {0}}, | |
{{}, {0}, {0}}, | |
{{0}, {0}, {0, 0}}, | |
{{0, 2}, {1, 3}, {0, 1, 2, 3}}, | |
{{0, 2, 7, 9 ,123}, {1, 3, 4, 5, 6}, {0, 1, 2, 3, 4, 5, 6, 7, 9, 123}}, | |
{{0, 2, 7, 9, 9, 123}, {1, 3, 4, 5, 5, 6, 7, 9}, {0, 1, 2, 3, 4, 5, 5, 6, 7, 7, 9, 9, 9, 123}} | |
}; | |
for (int[][] arrays : dataArrays) { | |
int[] firstArray = arrays[0]; | |
int[] secondArray = arrays[1]; | |
int[] resultArray = arrays[2]; | |
int[] result = merger.merge(firstArray, secondArray); | |
assertArrayEquals(resultArray, result); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment