Skip to content

Commit 62852f1

Browse files
jishnubnsajko
andauthored
Add extra tests suggested
Co-authored-by: Neven Sajko <[email protected]>
1 parent e1b0cce commit 62852f1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/abstractarray.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,4 +2157,20 @@ end
21572157

21582158
@testset "reshape with Integer sizes" begin
21592159
@test reshape(1:4, big(2), big(2)) == reshape(1:4, 2, 2)
2160+
a = [1 2 3; 4 5 6]
2161+
reshaped_arrays = (
2162+
reshape(a, 3, 2),
2163+
reshape(a, (3, 2)),
2164+
reshape(a, big(3), big(2)),
2165+
reshape(a, (big(3), big(2))),
2166+
reshape(a, :, big(2)),
2167+
reshape(a, (:, big(2))),
2168+
reshape(a, big(3), :),
2169+
reshape(a, (big(3), :)),
2170+
)
2171+
@test allequal(reshaped_arrays)
2172+
for b reshaped_arrays
2173+
@test b isa Matrix{Int}
2174+
@test b.ref === a.ref
2175+
end
21602176
end

0 commit comments

Comments
 (0)