From 6c90585d67b6405741ce944dedf45fe90676f4e7 Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Tue, 8 Oct 2019 18:10:59 +0200 Subject: [PATCH] Drop compat code for `cp` and `mv` from #512 --- README.md | 2 -- src/Compat.jl | 7 ------- test/old.jl | 20 ++++++++++++++++++++ test/runtests.jl | 20 -------------------- 4 files changed, 20 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index d5ee15cdc..ed5b8f32f 100644 --- a/README.md +++ b/README.md @@ -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`, diff --git a/src/Compat.jl b/src/Compat.jl index 643f056f2..852d2be92 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -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) diff --git a/test/old.jl b/test/old.jl index 550f1c192..6af23e7f2 100644 --- a/test/old.jl +++ b/test/old.jl @@ -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 diff --git a/test/runtests.jl b/test/runtests.jl index be6421795..80efc187d 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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]