Skip to content

Commit

Permalink
Avoid sparse(Matrix) constructer when testing sparse arrays with strings
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack committed Jul 28, 2017
1 parent 16465d9 commit 421c2d9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/sparse/higherorderfns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ end
stringorfloat_notzeropres(xs...) = all(iszero, xs) ? "hello" : zero(Float64)
for fn in (intorfloat_zeropres, intorfloat_notzeropres,
stringorfloat_zeropres, stringorfloat_notzeropres)
@test map(fn, A) == sparse(map(fn, fA))
@test broadcast(fn, A) == sparse(broadcast(fn, fA))
@test broadcast(fn, A, B) == sparse(broadcast(fn, fA, fB))
@test broadcast(fn, B, A) == sparse(broadcast(fn, fB, fA))
@test diag(map(fn, A)) == diag(map(fn, fA))
@test diag(broadcast(fn, A)) == diag(broadcast(fn, fA))
@test diag(broadcast(fn, A, B)) == diag(broadcast(fn, fA, fB))
@test diag(broadcast(fn, B, A)) == diag(broadcast(fn, fB, fA))
end
for fn in (intorfloat_zeropres, stringorfloat_zeropres)
@test broadcast(fn, A, B, A) == sparse(broadcast(fn, fA, fB, fA))
@test diag(broadcast(fn, A, B, A)) == diag(broadcast(fn, fA, fB, fA))
end
end

Expand Down

0 comments on commit 421c2d9

Please sign in to comment.