Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1754,6 +1754,7 @@ struct MyBigFill{T,N} <: AbstractArray{T,N}
val :: T
axes :: NTuple{N,Base.OneTo{BigInt}}
end
MyBigFill(val, sz::Tuple{}) = MyBigFill{typeof(val),0}(val, sz)
MyBigFill(val, sz::NTuple{N,BigInt}) where {N} = MyBigFill(val, map(Base.OneTo, sz))
MyBigFill(val, sz::Tuple{Vararg{Integer}}) = MyBigFill(val, map(BigInt, sz))
Base.size(M::MyBigFill) = map(length, M.axes)
Expand All @@ -1770,6 +1771,7 @@ function Base.reshape(M::MyBigFill, ind::NTuple{N,BigInt}) where {N}
length(M) == prod(ind) || throw(ArgumentError("length mismatch in reshape"))
MyBigFill(M.val, ind)
end
Base.reshape(M::MyBigFill, ind::Tuple{}) = MyBigFill(M.val, ind)

@testset "reshape" begin
A0 = [1 3; 2 4]
Expand Down Expand Up @@ -1928,6 +1930,12 @@ end
M = MyBigFill(4, (2, 3))
O = OffsetArray(M)
@test vec(O) isa MyBigFill
@test vec(O) == vec(M)

M = MyBigFill(4, (1,1))
O = OffsetArray(M)
@test reshape(O) == reshape(M)
@test reshape(O) isa MyBigFill
end
end

Expand Down
Loading