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

Function TestValidTree

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

validTreeFunction · 0.85

Tested by

no test coverage detected