Skip to content

Commit b52dc20

Browse files
author
openset
committed
Add: test case
1 parent b1afe82 commit b52dc20

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

problems/add-one-row-to-tree/add_one_row_to_tree_test.go

+12
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ func TestAddOneRow(t *testing.T) {
2828
d: 3,
2929
expected: []int{4, 2, kit.NULL, 1, 1, 3, kit.NULL, kit.NULL, 1},
3030
},
31+
{
32+
input: []int{3, 1},
33+
v: 1,
34+
d: 1,
35+
expected: []int{1, 3, kit.NULL, 1},
36+
},
37+
{
38+
input: []int{3, kit.NULL, 2},
39+
v: 1,
40+
d: 3,
41+
expected: []int{3, kit.NULL, 2, 1, 1},
42+
},
3143
}
3244
for _, tc := range tests {
3345
root := kit.SliceInt2TreeNode(tc.input)

0 commit comments

Comments
 (0)