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

Function Test_merge

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

mergeFunction · 0.70

Tested by

no test coverage detected