Skip to content

Commit

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

* `squeeze` is now `dropdims` ([#28303], [#26660]).

* `repmat` is now `repeat` ([#26039])

## New macros

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

if VERSION < v"0.7.0-DEV.3977" #26039
Base.repeat(A::AbstractArray, counts::Integer...) = Base.repeat(A, outer = counts)
Base.repeat(a::AbstractVecOrMat, m::Integer, n::Integer=1) = Base.repmat(a, m, n)
Base.repeat(a::AbstractVector, m::Integer) = Base.repmat(a, m)
end

if VERSION < v"0.7.0-DEV.2337"
# qr doesn't take the full keyword anymore since 0.7.0-DEV.5211; we still support it
# here to avoid unneccesary breakage
Expand Down
8 changes: 8 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1040,3 +1040,11 @@ let A = rand(5,5)
@test IndexStyle(selectdim(B, 2, 1)) == IndexStyle(view(B, :, 1, :)) == IndexCartesian()
@test IndexStyle(selectdim(B, 3, 1)) == IndexStyle(view(B, :, :, 1)) == IndexLinear()
end

@test repeat([1, 2], 3) == [1, 2, 1, 2, 1, 2]
@test repeat(1:4, 2) == [1, 2, 3, 4, 1, 2, 3, 4]
@test repeat([1 2; 3 4], 2, 3) == [1 2 1 2 1 2
3 4 3 4 3 4
1 2 1 2 1 2
3 4 3 4 3 4]
@test repeat([1, 2], 1, 2, 3) == [x for x in 1:2, y in 1:2, z in 1:3]
8 changes: 0 additions & 8 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,6 @@ if VERSION < v"0.7.0-beta2.143"
end
end

@test repeat([1, 2], 3) == [1, 2, 1, 2, 1, 2]
@test repeat(1:4, 2) == [1, 2, 3, 4, 1, 2, 3, 4]
@test repeat([1 2; 3 4], 2, 3) == [1 2 1 2 1 2
3 4 3 4 3 4
1 2 1 2 1 2
3 4 3 4 3 4]
@test repeat([1, 2], 1, 2, 3) == [x for x in 1:2, y in 1:2, z in 1:3]

# Support for positional `stop`
@test Compat.range(0, 5, length = 6) == 0.0:1.0:5.0
@test Compat.range(0, 10, step = 2) == 0:2:10
Expand Down

0 comments on commit b7320c0

Please sign in to comment.