@@ -177,9 +177,6 @@ B = similar(parent(A), (-3:3,1:4))
177
177
@test similar (Array{Int}, (0 : 0 , 0 : 0 )) isa OffsetArray{Int, 2 }
178
178
@test similar (Array{Int}, (1 , 1 )) isa Matrix{Int}
179
179
@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
183
180
184
181
# Reshape
185
182
B = reshape (A0, - 10 : - 9 , 9 : 10 )
@@ -196,7 +193,6 @@ b = reshape(A, -7:-4)
196
193
@test pointer (parent (b)) === pointer (parent (A))
197
194
@test parent (b) == A0[:]
198
195
a = OffsetArray (rand (3 ,3 ,3 ), - 1 : 1 , 0 : 2 , 3 : 5 )
199
- if VERSION >= v " 0.7.0-DEV.5242"
200
196
# Offset axes are required for reshape(::OffsetArray, ::Val) support
201
197
b = reshape (a, Val (2 ))
202
198
@test isa (b, OffsetArray{Float64,2 })
@@ -206,7 +202,6 @@ b = reshape(a, Val(4))
206
202
@test isa (b, OffsetArray{Float64,4 })
207
203
@test pointer (parent (b)) === pointer (parent (a))
208
204
@test axes (b) == (axes (a)... , Base. Slice (1 : 1 ))
209
- end
210
205
211
206
# Indexing with OffsetArray axes
212
207
i1 = OffsetArray ([2 ,1 ], (- 5 ,))
@@ -332,10 +327,8 @@ seek(io, 0)
332
327
amin, amax = extrema (parent (A))
333
328
@test clamp .(A, (amax+ amin)/ 2 , amax) == OffsetArray (clamp .(parent (A), (amax+ amin)/ 2 , amax), axes (A))
334
329
335
- if VERSION >= v " 0.7.0-DEV.5242"
336
330
@test unique (A, dims= 1 ) == OffsetArray (parent (A), 0 , first (axes (A, 2 )) - 1 )
337
331
@test unique (A, dims= 2 ) == OffsetArray (parent (A), first (axes (A, 1 )) - 1 , 0 )
338
- end
339
332
v = OffsetArray (rand (8 ), (- 2 ,))
340
333
@test sort (v) == OffsetArray (sort (parent (v)), v. offsets)
341
334
@test sortrows (A) == OffsetArray (sortrows (parent (A)), A. offsets)
@@ -376,13 +369,11 @@ for i = -3:3
376
369
end
377
370
@test unsafe_sum (a) == 0
378
371
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"
386
377
387
378
@testset " OffsetVector constructors" begin
388
379
local v = rand (5 )
0 commit comments