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

Function Test_threeSum

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

Source from the content-addressed store, hash-verified

6)
7
8func Test_threeSum(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: "three sum",
19 args: args{
20 nums: []int{-1, 0, 1, 2, -1, -4},
21 },
22 want: [][]int{
23 {-1, -1, 2},
24 {-1, 0, 1},
25 },
26 },
27 {
28 name: "three sum",
29 args: args{
30 nums: []int{-2, 0, 0, 2, 2},
31 },
32 want: [][]int{
33 {-2, 0, 2},
34 },
35 },
36 {
37 name: "three sum",
38 args: args{
39 nums: []int{0, 0, 0},
40 },
41 want: [][]int{
42 {0, 0, 0},
43 },
44 },
45 {
46 name: "three sum",
47 args: args{
48 nums: []int{-4, -2, 1, -5, -4, -4, 4, -2, 0, 4, 0, -2, 3, 1, -5, 0},
49 },
50 want: [][]int{
51 {-5, 1, 4},
52 {-4, 0, 4},
53 {-4, 1, 3},
54 {-2, -2, 4},
55 {-2, 1, 1},
56 {0, 0, 0},
57 },
58 },
59 // -2, 0, 0, 0, 2, 2
60 {
61 name: "three sum",
62 args: args{
63 nums: []int{-2, 0, 0, 0, 2, 2},
64 },
65 want: [][]int{

Callers

nothing calls this directly

Calls 1

threeSumFunction · 0.85

Tested by

no test coverage detected