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

Function Test_addTwoNumbers

add_two_numbers_2/solution_test.go:9–102  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func Test_addTwoNumbers(t *testing.T) {
10 type args struct {
11 l1 *structures.ListNode
12 l2 *structures.ListNode
13 }
14 tests := []struct {
15 name string
16 args args
17 want *structures.ListNode
18 }{
19 {
20 name: "add two numbers",
21 args: args{
22 l1: &structures.ListNode{
23 Val: 2,
24 Next: &structures.ListNode{
25 Val: 4,
26 Next: &structures.ListNode{
27 Val: 3,
28 Next: nil,
29 },
30 },
31 },
32 l2: &structures.ListNode{
33 Val: 5,
34 Next: &structures.ListNode{
35 Val: 6,
36 Next: &structures.ListNode{
37 Val: 4,
38 Next: nil,
39 },
40 },
41 },
42 },
43 want: &structures.ListNode{
44 Val: 7,
45 Next: &structures.ListNode{
46 Val: 0,
47 Next: &structures.ListNode{
48 Val: 8,
49 Next: nil,
50 },
51 },
52 },
53 },
54 {
55 name: "add two numbers",
56 args: args{
57 l1: &structures.ListNode{
58 Val: 1,
59 Next: &structures.ListNode{
60 Val: 0,
61 Next: &structures.ListNode{
62 Val: 0,
63 Next: &structures.ListNode{
64 Val: 1,
65 Next: nil,
66 },

Callers

nothing calls this directly

Calls 2

addTwoNumbersFunction · 0.85
addTwoNumbers2Function · 0.85

Tested by

no test coverage detected