From 4cfb6e9ae07e68270c0ddc9e4d677dbcba6e2bc2 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Thu, 7 Feb 2019 08:13:19 +0100 Subject: [PATCH] Add tests for reshape. --- test/runtests.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/runtests.jl b/test/runtests.jl index da524d3..372e479 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -47,6 +47,10 @@ Adapt.adapt_structure(to, xs::Wrapper) = Wrapper(adapt(to, xs.arr)) @test adapt(CustomArray, view(val.arr,:,:)) == view(val,:,:) @test adapt(CustomArray, view(val.arr,:,:)) isa SubArray{<:Any,<:Any,<:CustomArray} +# NOTE: manual creation of ReshapedArray because Base.Array has an optimized `reshape` +@test adapt(CustomArray, Base.ReshapedArray(val.arr,(2,2),())) == reshape(val,(2,2)) +@test adapt(CustomArray, Base.ReshapedArray(val.arr,(2,2),())) isa Base.ReshapedArray{<:Any,<:Any,<:CustomArray} + using LinearAlgebra