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

Function Test_rob

house_robber_198/solution_test.go:8–78  ·  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 single number case",
19 args: args{
20 nums: []int{
21 1,
22 },
23 },
24 want: 1,
25 },
26 {
27 name: "house robber two numbers case",
28 args: args{
29 nums: []int{
30 1, 2,
31 },
32 },
33 want: 2,
34 },
35 {
36 name: "house robber three numbers case [0 + 2]",
37 args: args{
38 nums: []int{
39 1, 2, 3,
40 },
41 },
42 want: 4,
43 },
44 {
45 name: "house robber three numbers case [1]",
46 args: args{
47 nums: []int{
48 1, 3, 1,
49 },
50 },
51 want: 3,
52 },
53 {
54 name: "house robber",
55 args: args{
56 nums: []int{
57 2, 7, 9, 3, 1,
58 },
59 },
60 want: 12,
61 },
62 {
63 name: "house robber",
64 args: args{
65 nums: []int{

Callers

nothing calls this directly

Calls 2

rob0Function · 0.85
robFunction · 0.70

Tested by

no test coverage detected