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

Function Test_generate

pascals_triangle_118/solution_test.go:9–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func Test_generate(t *testing.T) {
10 type args struct {
11 numRows int
12 }
13 tests := []struct {
14 name string
15 args args
16 want [][]int
17 }{
18 {
19 name: "pascal's triangle",
20 args: args{
21 numRows: 5,
22 },
23 want: [][]int{
24 {1},
25 {1, 1},
26 {1, 2, 1},
27 {1, 3, 3, 1},
28 {1, 4, 6, 4, 1},
29 },
30 },
31 {
32 name: "pascal's triangle",
33 args: args{
34 numRows: 1,
35 },
36 want: [][]int{
37 {1},
38 },
39 },
40 }
41 for _, tt := range tests {
42 t.Run(tt.name, func(t *testing.T) {
43 assert.Equal(t, tt.want, generate(tt.args.numRows))
44 })
45 }
46}

Callers

nothing calls this directly

Calls 1

generateFunction · 0.85

Tested by

no test coverage detected