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

Function Test_rob

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

robFunction · 0.70

Tested by

no test coverage detected