Skip to content

Commit

Permalink
Test that broadcast doesn't propagate too much
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloferz committed Dec 31, 2016
1 parent e0f1cb1 commit e5c270a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -409,3 +409,12 @@ Base.Broadcast.broadcast_c(f, ::Type{Array19745}, A, Bs...) =
@test isa(aa .+ 1, Array19745)
@test isa(aa .* aa', Array19745)
end

# broadcast should only "peel off" one container layer
let io = IOBuffer()
broadcast(x -> print(io, x), [Nullable(1.0)])
@test String(take!(io)) == "Nullable{Float64}(1.0)"
v = []
broadcast(x -> push!(v, x), [Nullable(1)])
@test get.(v) == get.([Nullable(1)])
end

0 comments on commit e5c270a

Please sign in to comment.