We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7bc016 commit 9cefca4Copy full SHA for 9cefca4
test/runtests.jl
@@ -124,6 +124,23 @@ end
124
@test axes(y) == (r,)
125
end
126
127
+@testset "OffsetArray of OffsetArray construction" begin
128
+ # guarantee no unnecessary nesting of `OffsetArray`s
129
+ r = -2:5
130
+ d = collect(r)
131
+ y = OffsetArray(d, r)
132
+
133
+ # range constructor
134
+ y0 = OffsetArray(y, 0:7)
135
+ @test y0[0] == r[1]
136
+ @test typeof(parent(y0)) <: Array
137
138
+ # offset constructor
139
+ y1 = OffsetArray(y, +2)
140
+ @test y1[0] == r[1]
141
+ @test typeof(parent(y1)) <: Array
142
+end
143
144
@testset "Axes supplied to constructor correspond to final result" begin
145
# Ref https://github.com/JuliaArrays/OffsetArrays.jl/pull/65#issuecomment-457181268
146
B = BidirectionalVector([1, 2, 3], -2)
0 commit comments