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

Function Test_twoSum

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

twoSumFunction · 0.85

Tested by

no test coverage detected