MCPcopy Create free account
hub / github.com/austingebauer/go-leetcode / Test_gameOfLife

Function Test_gameOfLife

game_of_life_289/solution_test.go:8–57  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func Test_gameOfLife(t *testing.T) {
9 type args struct {
10 board [][]int
11 }
12 tests := []struct {
13 name string
14 args args
15 want [][]int
16 }{
17 {
18 name: "game of life",
19 args: args{
20 board: [][]int{
21 {
22 0, 1, 0,
23 },
24 {
25 0, 0, 1,
26 },
27 {
28 1, 1, 1,
29 },
30 {
31 0, 0, 0,
32 },
33 },
34 },
35 want: [][]int{
36 {
37 0, 0, 0,
38 },
39 {
40 1, 0, 1,
41 },
42 {
43 0, 1, 1,
44 },
45 {
46 0, 1, 0,
47 },
48 },
49 },
50 }
51 for _, tt := range tests {
52 t.Run(tt.name, func(t *testing.T) {
53 gameOfLife(tt.args.board)
54 assert.Equal(t, tt.want, tt.args.board)
55 })
56 }
57}

Callers

nothing calls this directly

Calls 1

gameOfLifeFunction · 0.85

Tested by

no test coverage detected