Skip to content

Commit

Permalink
Drop compat code for cp and mv from #512
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Oct 8, 2019
1 parent 15d98d3 commit 1da4921
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 29 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ Currently, the `@compat` macro supports the following syntaxes:

* `range` supporting `stop` as positional argument ([#28708]).

* `Compat.mv` and `Compat.cp` with `force` keyword argument ([#26069]).

* `Compat.accumulate`, `Compat.accumulate!`, `Compat.all`, `Compat.any`,
`Compat.cumprod`, `Compat.cumprod!`, `Compat.cumsum`, `Compat.cumsum!`,
`Compat.findmax`, `Compat.findmin`, `Compat.mapreduce`, `Compat.maximum`,
Expand Down
7 changes: 0 additions & 7 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ end
end
end

@static if VERSION < v"0.7.0-DEV.3995"
cp(src::AbstractString, dst::AbstractString; force::Bool=false, follow_symlinks::Bool=false) =
Base.cp(src, dst; remove_destination = force, follow_symlinks = follow_symlinks)
mv(src::AbstractString, dst::AbstractString; force::Bool=false) =
Base.mv(src, dst; remove_destination = force)
end

if VERSION < v"0.7.0-DEV.3972"
function indexin(a, b::AbstractArray)
inds = keys(b)
Expand Down
20 changes: 20 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -836,3 +836,23 @@ end
@test Compat.range(2, stop=8) == 2:8
@test Compat.range(2, step=2, length=8) == 2:2:16
@test Compat.range(1.0, stop=2.0, length=3) == 1.0:0.5:2.0

# 0.7.0-DEV.3995
mktempdir(@__DIR__) do dir
src = joinpath(dir, "src.jl")
touch(src)
dest = joinpath(dir, "dest.jl")
touch(dest)
open(src, "w") do f
write(f, "Hello, world!")
end
Compat.cp(src, dest, force = true)
open(dest, "r") do f
@test read(f, String) == "Hello, world!"
end
Compat.mv(src, dest, force = true)
open(dest, "r") do f
@test read(f, String) == "Hello, world!"
end
@test readdir(dir) == ["dest.jl"]
end
20 changes: 0 additions & 20 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,26 +89,6 @@ if VERSION < v"0.7.0-DEV.4592"
@test findall(occursin([1, 2]), [1]) == [1]
end

# 0.7.0-DEV.3995
mktempdir(@__DIR__) do dir
src = joinpath(dir, "src.jl")
touch(src)
dest = joinpath(dir, "dest.jl")
touch(dest)
open(src, "w") do f
write(f, "Hello, world!")
end
Compat.cp(src, dest, force = true)
open(dest, "r") do f
@test read(f, String) == "Hello, world!"
end
Compat.mv(src, dest, force = true)
open(dest, "r") do f
@test read(f, String) == "Hello, world!"
end
@test readdir(dir) == ["dest.jl"]
end

# 0.7.0-DEV.3972
@test Compat.indexin([1, 2], [1, 0, 1]) == [1, nothing]

Expand Down

0 comments on commit 1da4921

Please sign in to comment.