Skip to content

Commit

Permalink
Drop compat code for mapslices from #588
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Oct 8, 2019
1 parent 9de49e6 commit 0388309
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ Currently, the `@compat` macro supports the following syntaxes:

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

* `mapslices` with `dims` keyword argument ([#27828]).

* `hasproperty` and `hasfield` ([#28850]).
`hasproperty` is defined only for Julia 0.7 or later.

Expand Down
6 changes: 0 additions & 6 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@ end
end
end

# https://github.com/JuliaLang/julia/pull/27828
if VERSION < v"0.7.0-beta.73"
Base.mapslices(f, A::AbstractArray; dims=error("required keyword argument `dims` missing")) =
mapslices(f, A, dims)
end

# https://github.com/JuliaLang/julia/pull/28302
if VERSION < v"0.7.0-beta2.169"
const floatmin = realmin
Expand Down
10 changes: 10 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1254,3 +1254,13 @@ let
@test Compat.split(str, r"\.+:\.+"; limit=3, keepempty=false) == ["a","ba","cba.:.:.dcba.:."]
@test Compat.split(str, r"\.+:\.+"; limit=3, keepempty=true) == ["a","ba","cba.:.:.dcba.:."]
end

# 0.7.0-beta.73
let a = rand(5,5)
s = mapslices(sort, a, dims=[1])
S = mapslices(sort, a, dims=[2])
for i = 1:5
@test s[:,i] == sort(a[:,i])
@test vec(S[i,:]) == sort(vec(a[i,:]))
end
end
10 changes: 0 additions & 10 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,6 @@ let
@test_throws UndefKeywordError func5(x=2)
end

# 0.7.0-beta.73
let a = rand(5,5)
s = mapslices(sort, a, dims=[1])
S = mapslices(sort, a, dims=[2])
for i = 1:5
@test s[:,i] == sort(a[:,i])
@test vec(S[i,:]) == sort(vec(a[i,:]))
end
end

# 0.7.0-beta2.169
@test floatmin(Float16) == @eval $(Core.Intrinsics.bitcast(Float16, 0x0400))
@test floatmax(Float32) == @eval $(Core.Intrinsics.bitcast(Float32, 0x7f7fffff))
Expand Down

0 comments on commit 0388309

Please sign in to comment.