Skip to content

Commit 7481daf

Browse files
committed
Create making-a-large-island_test.go
1 parent 200d5f3 commit 7481daf

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package making_a_large_island
2+
3+
import "testing"
4+
5+
func Test_largestIsland(t *testing.T) {
6+
type args struct {
7+
grid [][]int
8+
}
9+
tests := []struct {
10+
name string
11+
args args
12+
want int
13+
}{
14+
{
15+
name: "test case 1",
16+
args: args{
17+
grid: [][]int{
18+
{1, 1, 1, 1},
19+
{0, 1, 0, 1},
20+
{0, 0, 1, 0},
21+
{0, 0, 0, 1},
22+
},
23+
},
24+
want: 9,
25+
},
26+
}
27+
for _, tt := range tests {
28+
t.Run(tt.name, func(t *testing.T) {
29+
if got := largestIsland(tt.args.grid); got != tt.want {
30+
t.Errorf("largestIsland() = %v, want %v", got, tt.want)
31+
}
32+
})
33+
}
34+
}

0 commit comments

Comments
 (0)