Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added tests, edited errors #377

Merged
merged 4 commits into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions test/stdlib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,31 @@ end
let
@show "test deque"
deque1 = StdDeque{Int64}()
deque2 = StdDeque{Int64}(5, 3)
@test length(deque1) == 0
@test length(deque2) == 5
push!(deque1, 7)
push!(deque1, 9)
pushfirst!(deque1, 9)
@test length(deque1) == 2
deque2 = deque1
resize!(deque2, 3)
@test length(deque2) == 3
resize!(deque2, 8)
@test length(deque2) == 8
setindex!(deque2, 0, 1)
@test getindex(deque2, 1) == 0
pop!(deque2)
popfirst!(deque2)
@test length(deque2) == 1
@test length(deque2) == 6
@test isempty(deque2) == false
empty!(deque2)
@test isempty(deque2) == true
deque3 = deque1
@test length(deque3) == 2
(val, state) = iterate(deque3)
@test val == 9
(val, state) = iterate(deque3, state)
@test val == 7
@test state == nothing
end

end
Loading