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 for Base.copy! #52682

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions stdlib/Future/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Test
using Future
29 changes: 28 additions & 1 deletion test/copy.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Random

mainres = ([4, 5, 3],
[1, 5, 3])
bitres = ([true, true, false],
Expand Down Expand Up @@ -268,3 +267,31 @@ end
@test islocked(a.lock)
@test !islocked(b.lock)
end

"""
Basic tests for Base.copy!
"""

using Test
using Future

@testset "Testing copy! for sets" begin
dst = Set([]) # Create an empty set
src = Set([1, 24, 5, 6, 51, 62])
copy!(dst, src)
@test dst == src
end

@testset "Testing copy! for Dictionaries" begin
dst = Dict("a" => 1, "b" => 2)
src = Dict("c" => 3, "d" => 4)
copy!(dst, src)
@test dst == src
end

@testset "Testing copy! for Arrays" begin
dst = [1, 2, 3]
src = [4, 5, 6]
copy!(dst, src)
@test dst == src
end