Skip to content

Commit

Permalink
Mark tests for sparse broadcast shape checks that should be strengthe…
Browse files Browse the repository at this point in the history
…ned [ci skip].
  • Loading branch information
Sacha0 committed Dec 30, 2016
1 parent 913f637 commit 2786db2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/sparse/higherorderfns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ end
@test broadcast(+, X, Y) == sparse(broadcast(+, fX, fY))
@test broadcast(*, X, Y) == sparse(broadcast(*, fX, fY))
@test broadcast(f, X, Y) == sparse(broadcast(f, fX, fY))
# TODO strengthen this test, avoiding dependence on checking whether
# broadcast_indices throws to determine whether sparse broadcast should throw
try
Base.Broadcast.broadcast_indices(spzeros((shapeX .- 1)...), Y)
catch
Expand All @@ -125,6 +127,8 @@ end
@test (@allocated broadcast!(f, Z, X, Y)) == 0
@test broadcast!(f, Z, X, Y) == sparse(broadcast!(f, fZ, fX, fY))
# --> test shape checks for both broadcast and broadcast! entry points
# TODO strengthen this test, avoiding dependence on checking whether
# broadcast_indices throws to determine whether sparse broadcast should throw
try
Base.Broadcast.check_broadcast_indices(indices(Z), spzeros((shapeX .- 1)...), Y)
catch
Expand All @@ -150,6 +154,8 @@ end
@test broadcast(+, X, Y, Z) == sparse(broadcast(+, fX, fY, fZ))
@test broadcast(*, X, Y, Z) == sparse(broadcast(*, fX, fY, fZ))
@test broadcast(f, X, Y, Z) == sparse(broadcast(f, fX, fY, fZ))
# TODO strengthen this test, avoiding dependence on checking whether
# broadcast_indices throws to determine whether sparse broadcast should throw
try
Base.Broadcast.broadcast_indices(spzeros((shapeX .- 1)...), Y, Z)
catch
Expand All @@ -176,6 +182,8 @@ end
# almost certainly should not allocate. so not certain what's going on.
@test broadcast!(f, Q, X, Y, Z) == sparse(broadcast!(f, fQ, fX, fY, fZ))
# --> test shape checks for both broadcast and broadcast! entry points
# TODO strengthen this test, avoiding dependence on checking whether
# broadcast_indices throws to determine whether sparse broadcast should throw
try
Base.Broadcast.check_broadcast_indices(indices(Q), spzeros((shapeX .- 1)...), Y, Z)
catch
Expand Down

0 comments on commit 2786db2

Please sign in to comment.