(t *testing.T)
| 40 | } |
| 41 | |
| 42 | func TestUnique(t *testing.T) { |
| 43 | t.Parallel() |
| 44 | |
| 45 | require.ElementsMatch(t, |
| 46 | []int{1, 2, 3, 4, 5}, |
| 47 | slice.Unique([]int{ |
| 48 | 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, |
| 49 | })) |
| 50 | |
| 51 | require.ElementsMatch(t, |
| 52 | []string{"a"}, |
| 53 | slice.Unique([]string{ |
| 54 | "a", "a", "a", |
| 55 | })) |
| 56 | |
| 57 | require.ElementsMatch(t, |
| 58 | []int{1, 2, 3, 4, 5}, |
| 59 | slice.UniqueFunc([]int{ |
| 60 | 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, |
| 61 | }, func(a, b int) bool { |
| 62 | return a == b |
| 63 | })) |
| 64 | |
| 65 | require.ElementsMatch(t, |
| 66 | []string{"a"}, |
| 67 | slice.UniqueFunc([]string{ |
| 68 | "a", "a", "a", |
| 69 | }, func(a, b string) bool { |
| 70 | return a == b |
| 71 | })) |
| 72 | } |
| 73 | |
| 74 | func TestContains(t *testing.T) { |
| 75 | t.Parallel() |
nothing calls this directly
no test coverage detected