Skip to content

Commit 17eef91

Browse files
committed
test that stored zeros are still stored zeros in the diag
1 parent a77a206 commit 17eef91

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/sparse/sparse.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,10 @@ end
13381338
@test_throws ArgumentError diag(S, size(S,2)+1)
13391339
end
13401340
end
1341+
# test that stored zeros are still stored zeros in the diagonal
1342+
S = sparse([1,3],[1,3],[0.0,0.0]); V = diag(S)
1343+
@test V.nzind == [1,3]
1344+
@test V.nzval == [0.0,0.0]
13411345
end
13421346

13431347
@testset "expandptr" begin

0 commit comments

Comments
 (0)