Repository navigation
Expand file tree
/
Copy path_1091Test.java
More file actions
56 lines (45 loc) · 1.59 KB
/
Copy path_1091Test.java
File metadata and controls
56 lines (45 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package com.fishercoder;
import com.fishercoder.common.utils.CommonUtils;
import com.fishercoder.solutions._1091;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class _1091Test {
private static _1091.Solution1 solution1;
@BeforeClass
public static void setup() {
solution1 = new _1091.Solution1();
}
@Test
public void test1() {
assertEquals(2, solution1.shortestPathBinaryMatrix(new int[][]{
{0, 1},
{1, 0}
}));
}
@Test
public void test2() {
assertEquals(4, solution1.shortestPathBinaryMatrix(CommonUtils.convertLeetCodeIrregularLengths2DArrayInputIntoJavaArray("[0,0,0],[1,1,0],[1,1,0]")));
}
@Test
public void test3() {
assertEquals(-1, solution1.shortestPathBinaryMatrix(CommonUtils.convertLeetCodeIrregularLengths2DArrayInputIntoJavaArray("[1,0,0],[1,1,0],[1,1,0]")));
}
@Test
public void test4() {
assertEquals(-1, solution1.shortestPathBinaryMatrix(CommonUtils.convertLeetCodeIrregularLengths2DArrayInputIntoJavaArray("[0,0,0],[1,1,0],[1,1,1]")));
}
@Test
public void test5() {
assertEquals(1, solution1.shortestPathBinaryMatrix(new int[][]{
{0}
}));
}
@Test
public void test6() {
assertEquals(7, solution1.shortestPathBinaryMatrix(new int[][]{
{0, 1, 0, 0, 1, 1, 0}, {1, 0, 0, 0, 0, 0, 0}, {1, 0, 0, 1, 1, 1, 1}, {0, 1, 0, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 0, 1}, {1, 0, 0, 1, 0, 0, 0}, {1, 0, 1, 0, 0, 1, 0}
}))
;
}
}