Skip to content

Commit 19b5717

Browse files
committed
Add more test
1 parent 432dcb9 commit 19b5717

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

test/broadcast.jl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ end
291291
Base.@propagate_inbounds Base.getindex(A::WrapArray, i::Integer...) = A.data[i...]
292292
Base.@propagate_inbounds Base.setindex!(A::WrapArray, v::Any, i::Integer...) = setindex!(A.data, v, i...)
293293
Base.size(A::WrapArray) = size(A.data)
294+
Base.axes(A::WrapArray) = axes(A.data)
294295
Broadcast.BroadcastStyle(::Type{WrapArray{T,N,P}}) where {T,N,P} = Broadcast.BroadcastStyle(P)
295296
StaticArrays.isstatic(A::WrapArray) = StaticArrays.isstatic(A.data)
296297
StaticArrays.Size(::Type{WrapArray{T,N,P}}) where {T,N,P} = StaticArrays.Size(P)
@@ -302,10 +303,14 @@ end
302303
data = (1, 2)
303304
for T in (SVector{2}, MVector{2})
304305
a = T(data)
305-
b = WrapArray(a)
306-
@test @inferred(b .+ a) isa T
307-
@test @inferred(b .+ b) isa T
308-
@test @inferred(b .+ (1, 2)) isa T
309-
@test b .+ a == b .+ b == a .+ a
306+
for b in (WrapArray(a), WrapArray(a'))
307+
@test @inferred(b .+ a) isa T
308+
@test @inferred(b .+ b) isa T
309+
@test @inferred(b .+ (1, 2)) isa T
310+
@test @inferred(b .+ a') isa StaticMatrix
311+
@test @inferred(a' .+ b) isa StaticMatrix
312+
# @test @inferred(b' .+ a') isa StaticMatrix # Adjoint doesn't propagate style
313+
@test b .+ b.data == b .+ b == b.data .+ b.data
314+
end
310315
end
311316
end

0 commit comments

Comments
 (0)