Skip to content

Commit

Permalink
test: StdPriorityQueue
Browse files Browse the repository at this point in the history
  • Loading branch information
PraneethJain committed Jun 13, 2024
1 parent 252c584 commit b5ef894
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/stdlib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,26 @@ let
@test length(queue) == 1
end

@testset "StdPriorityQueue" begin
pq = StdPriorityQueue{Int64}()
@test length(pq) == 0
push!(pq, 5)
push!(pq, 1)
@test isempty(pq) == false
pq = push!(pq, 4)
pq = push!(pq, 10)
@test length(pq) == 4
@test first(pq) == 10
@test pop!(pq) == 10
@test length(pq) == 3
@test pop!(pq) == 5
@test pop!(pq) == 4
@test pop!(pq) == 1
@test isempty(pq) == true
@test isnothing(first(pq))
@test_throws ArgumentError pop!(pq)
end

@testset "StdSet and StdUnorderedSet" begin
for StdSetType in (StdSet, StdUnorderedSet)
@testset "Set with integers" begin
Expand Down

0 comments on commit b5ef894

Please sign in to comment.