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

Function Test_isSameTree

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

isSameTreeFunction · 0.85

Tested by

no test coverage detected