Skip to content

Commit cc0ae52

Browse files
authored
Merge pull request #51 from JuliaArrays/fbot/deps
Fix deprecations
2 parents b604843 + 8d9288f commit cc0ae52

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

test/runtests.jl

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,6 @@ B = similar(parent(A), (-3:3,1:4))
177177
@test similar(Array{Int}, (0:0, 0:0)) isa OffsetArray{Int, 2}
178178
@test similar(Array{Int}, (1, 1)) isa Matrix{Int}
179179
@test similar(Array{Int}, (Base.OneTo(1), Base.OneTo(1))) isa Matrix{Int}
180-
if VERSION < v"0.7.0-DEV.4873"
181-
@test similar(x->zeros(1, 1), (0:0, 0:0)) isa OffsetArray{Float64, 2}
182-
end
183180

184181
# Reshape
185182
B = reshape(A0, -10:-9, 9:10)
@@ -196,7 +193,6 @@ b = reshape(A, -7:-4)
196193
@test pointer(parent(b)) === pointer(parent(A))
197194
@test parent(b) == A0[:]
198195
a = OffsetArray(rand(3,3,3), -1:1, 0:2, 3:5)
199-
if VERSION >= v"0.7.0-DEV.5242"
200196
# Offset axes are required for reshape(::OffsetArray, ::Val) support
201197
b = reshape(a, Val(2))
202198
@test isa(b, OffsetArray{Float64,2})
@@ -206,7 +202,6 @@ b = reshape(a, Val(4))
206202
@test isa(b, OffsetArray{Float64,4})
207203
@test pointer(parent(b)) === pointer(parent(a))
208204
@test axes(b) == (axes(a)..., Base.Slice(1:1))
209-
end
210205

211206
# Indexing with OffsetArray axes
212207
i1 = OffsetArray([2,1], (-5,))
@@ -332,10 +327,8 @@ seek(io, 0)
332327
amin, amax = extrema(parent(A))
333328
@test clamp.(A, (amax+amin)/2, amax) == OffsetArray(clamp.(parent(A), (amax+amin)/2, amax), axes(A))
334329

335-
if VERSION >= v"0.7.0-DEV.5242"
336330
@test unique(A, dims=1) == OffsetArray(parent(A), 0, first(axes(A, 2)) - 1)
337331
@test unique(A, dims=2) == OffsetArray(parent(A), first(axes(A, 1)) - 1, 0)
338-
end
339332
v = OffsetArray(rand(8), (-2,))
340333
@test sort(v) == OffsetArray(sort(parent(v)), v.offsets)
341334
@test sortrows(A) == OffsetArray(sortrows(parent(A)), A.offsets)
@@ -376,13 +369,11 @@ for i = -3:3
376369
end
377370
@test unsafe_sum(a) == 0
378371

379-
if VERSION >= v"0.7.0-DEV.1790"
380-
a = OffsetArray([1 2; 3 4], -1:0, 5:6)
381-
@test summary(a) == "OffsetArray(::Array{$(Int),2}, -1:0, 5:6) with eltype $(Int) with indices -1:0×5:6"
382-
@test summary(view(a, :, 5)) == "view(OffsetArray(::Array{Int64,2}, -1:0, 5:6), :, 5) with eltype Int64 with indices -1:0"
383-
a = OffsetArray(reshape([1]))
384-
@test summary(a) == "0-dimensional OffsetArray(::Array{Int64,0}) with eltype Int64"
385-
end
372+
a = OffsetArray([1 2; 3 4], -1:0, 5:6)
373+
@test summary(a) == "OffsetArray(::Array{$(Int),2}, -1:0, 5:6) with eltype $(Int) with indices -1:0×5:6"
374+
@test summary(view(a, :, 5)) == "view(OffsetArray(::Array{Int64,2}, -1:0, 5:6), :, 5) with eltype Int64 with indices -1:0"
375+
a = OffsetArray(reshape([1]))
376+
@test summary(a) == "0-dimensional OffsetArray(::Array{Int64,0}) with eltype Int64"
386377

387378
@testset "OffsetVector constructors" begin
388379
local v = rand(5)

0 commit comments

Comments
 (0)