(t *testing.T)
| 6 | ) |
| 7 | |
| 8 | func 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 | } |
nothing calls this directly
no test coverage detected