diff --git a/src/SparseMatrixCSR.jl b/src/SparseMatrixCSR.jl index 24f9bb4..232a4f2 100644 --- a/src/SparseMatrixCSR.jl +++ b/src/SparseMatrixCSR.jl @@ -335,7 +335,7 @@ function show(io::IOContext, S::SparseMatrixCSR{Bi}) where{Bi} nnz(S) == 0 && return show(io, MIME("text/plain"), S) ioc = IOContext(io, :compact => true) - function _format_line(r, col, padr, padc,o) + function _format_line(r, col, padr, padc, o=0) print(ioc, "\n [", rpad(col+o, padr), ", ", lpad(S.colval[r]+o, padc), "] = ") if isassigned(S.nzval, Int(r)) show(ioc, S.nzval[r]) diff --git a/test/SparseMatrixCSR.jl b/test/SparseMatrixCSR.jl index 0526062..f993c62 100644 --- a/test/SparseMatrixCSR.jl +++ b/test/SparseMatrixCSR.jl @@ -25,7 +25,8 @@ function test_csr(Bi,Tv,Ti) @test copy(CSR) == CSC end CSR = sparsecsr(Val(Bi),I,J,V) - show(CSR) + show(IOContext(stdout, :limit=>true, :displaysize=>(10,10)), CSR) + show(IOContext(stdout, :limit=>false), CSR) @test CSR == CSC @test copy(CSR) == CSC @test eltype(CSR) == Tv