Skip to content

Commit ede00ba

Browse files
committed
Fix truncated show(...) for SparseMatrixCSR
1 parent dbe71cf commit ede00ba

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/SparseMatrixCSR.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ function show(io::IOContext, S::SparseMatrixCSR{Bi}) where{Bi}
335335
nnz(S) == 0 && return show(io, MIME("text/plain"), S)
336336
ioc = IOContext(io, :compact => true)
337337

338-
function _format_line(r, col, padr, padc,o)
338+
function _format_line(r, col, padr, padc, o=0)
339339
print(ioc, "\n [", rpad(col+o, padr), ", ", lpad(S.colval[r]+o, padc), "] = ")
340340
if isassigned(S.nzval, Int(r))
341341
show(ioc, S.nzval[r])

test/SparseMatrixCSR.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ function test_csr(Bi,Tv,Ti)
2525
@test copy(CSR) == CSC
2626
end
2727
CSR = sparsecsr(Val(Bi),I,J,V)
28-
show(CSR)
28+
show(IOContext(stdout, :limit=>true, :displaysize=>(10,10)), CSR)
29+
show(IOContext(stdout, :limit=>false), CSR)
2930
@test CSR == CSC
3031
@test copy(CSR) == CSC
3132
@test eltype(CSR) == Tv

0 commit comments

Comments
 (0)