Skip to content

Commit faf6f93

Browse files
committed
Add more tests
1 parent 123d257 commit faf6f93

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/runtests.jl

+13
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,19 @@ using Test
140140
@test tree.root.left.key == 1
141141
@test tree.root.right.key == 3
142142

143+
# deleting the root node
144+
tree = AVLTree{Int,Int}()
145+
tree[4] = 40
146+
tree[2] = 20
147+
tree[5] = 50
148+
tree[1] = 10
149+
tree[3] = 30
150+
delete!(tree, 4)
151+
@test tree.root.key == 2
152+
@test tree.root.left.key == 1
153+
@test tree.root.right.key == 5
154+
@test tree.root.right.left.key == 3
155+
143156
# tree that accepts any types
144157
tree = AVLTree()
145158
tree[2] = 'A'

0 commit comments

Comments
 (0)