Skip to content

Commit f2314fa

Browse files
committed
add test
1 parent 588ba81 commit f2314fa

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/sparsematrix_ops.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,4 +442,15 @@ end
442442
@test one(A) isa SparseMatrixCSC{Int}
443443
end
444444

445+
@testset "transpose! does not allocate" begin
446+
function f()
447+
A = sprandn(10, 10, 0.1)
448+
X = deepcopy(A)
449+
return @allocated transpose!(X, A)
450+
end
451+
#precompile
452+
f()
453+
f()
454+
@test f() == 0
455+
end
445456
end # module

0 commit comments

Comments
 (0)