(t *testing.T)
| 6 | ) |
| 7 | |
| 8 | func Test_combinationSum4(t *testing.T) { |
| 9 | type args struct { |
| 10 | nums []int |
| 11 | target int |
| 12 | } |
| 13 | tests := []struct { |
| 14 | name string |
| 15 | args args |
| 16 | want int |
| 17 | }{ |
| 18 | { |
| 19 | name: "combination sum iv", |
| 20 | args: args{ |
| 21 | nums: []int{ |
| 22 | 1, 2, 3, |
| 23 | }, |
| 24 | target: 4, |
| 25 | }, |
| 26 | want: 7, |
| 27 | }, |
| 28 | { |
| 29 | name: "combination sum iv", |
| 30 | args: args{ |
| 31 | nums: []int{ |
| 32 | 3, |
| 33 | }, |
| 34 | target: 5, |
| 35 | }, |
| 36 | want: 0, |
| 37 | }, |
| 38 | } |
| 39 | for _, tt := range tests { |
| 40 | t.Run(tt.name, func(t *testing.T) { |
| 41 | assert.Equal(t, tt.want, combinationSum4(tt.args.nums, tt.args.target)) |
| 42 | }) |
| 43 | } |
| 44 | } |
nothing calls this directly
no test coverage detected