Skip to content

Commit 6d1ec06

Browse files
committed
deprecate and test top
1 parent f95960c commit 6d1ec06

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/DataStructures.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,4 @@ module DataStructures
112112
include("splay_tree.jl")
113113

114114
include("deprecations.jl")
115-
@deprecate top(x) = first(h)
116-
end
115+
end

src/deprecations.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# 0.18 deprecations. Remove before releasing 0.19
22
@deprecate path(t::Trie, str::AbstractString) partial_path(t::Trie, str::AbstractString)
33
@deprecate find_root find_root!
4+
@deprecate top first

test/test_deprecations.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,9 @@
1414
@test collect(path(t, "robb")) == [t0, t1, t2, t3]
1515
@test collect(path(t, "ro")) == [t0, t1, t2]
1616
@test collect(path(t, "roa")) == [t0, t1, t2]
17+
end
18+
19+
@testset "top" begin
20+
hh = BinaryMinHeap{Float64}([1,2,3])
21+
@test top(hh) == 1
1722
end

0 commit comments

Comments
 (0)