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

Function Test_reorderList

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

reorderListFunction · 0.85

Tested by

no test coverage detected