Skip to content

Commit 9f0c141

Browse files
committed
Add more tests
1 parent 123d257 commit 9f0c141

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/runtests.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@ using Test
106106
@test tree.root.key == 2
107107
@test tree.root.left.key == 1
108108
@test tree.root.right.key == 3
109+
# larger tree that needs more adjustments
110+
tree = AVLTree{Int,Int}()
111+
tree[4] = 40
112+
tree[2] = 20
113+
tree[10] = 0
114+
tree[1] = 10
115+
tree[3] = 30
116+
delete!(tree, 10)
117+
@test tree.root.key == 2
118+
@test tree.root.left.key == 1
119+
@test tree.root.right.key == 4
120+
@test tree.root.right.left.key == 3
109121

110122
# left rotate
111123
tree = AVLTree{Int,Int}()

0 commit comments

Comments
 (0)