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

Function Test_containsDuplicate

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

Source from the content-addressed store, hash-verified

6)
7
8func 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}

Callers

nothing calls this directly

Calls 1

containsDuplicateFunction · 0.85

Tested by

no test coverage detected