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