(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func 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 | }, |
nothing calls this directly
no test coverage detected