File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -33,13 +33,14 @@ include("../src/red_black_tree.jl")
33
33
@test search_key (t, i)
34
34
end
35
35
36
+ # for handling cases related to delete!
36
37
t2 = RBTree ()
37
- for i = 1 : 10000
38
+ for i = 1 : 100000
38
39
insert! (t2, i)
39
40
end
40
41
41
- nums = rand (1 : 10000 , 100 )
42
- visited = Set {Int} ()
42
+ nums = rand (1 : 100000 , 1000 )
43
+ visited = Set ()
43
44
for num in nums
44
45
if num in visited
45
46
@test_throws KeyError delete! (t2, num)
@@ -49,12 +50,22 @@ include("../src/red_black_tree.jl")
49
50
end
50
51
end
51
52
52
- for i = 1 : 10000
53
+ for i = 1 : 100000
53
54
if i in visited
54
55
@test ! search_key (t2, i)
55
56
else
56
57
@test search_key (t2, i)
57
58
end
58
59
end
59
60
61
+ # for handling cases related to insert!
62
+ t3 = RBTree ()
63
+ for num in nums
64
+ insert! (t3, num)
65
+ end
66
+
67
+ for i in visited
68
+ @test search_key (t3, i)
69
+ end
70
+
60
71
end
You can’t perform that action at this time.
0 commit comments