dump missing trailing newline

78 views
Skip to first unread message

Curtis Vogt

unread,
Jun 24, 2016, 7:56:22 PM6/24/16
to julia-dev
I've been working on fixing the doctests and I noticed that `dump` seems to be missing an ending newline. Is this intentional? 

julia> dump(:(1 + 1))
Expr
  head
: Symbol call
  args
: Array{Any}((3,))
   
1: Symbol +
   
2: Int64 1
   
3: Int64 1
  typ
: Any
julia
> buf = IOBuffer();


julia
> dump(buf, :(1 + 1))


julia
> seekstart(buf); readstring(buf)
"Expr\n  head: Symbol call\n  args: Array{Any}((3,))\n    1: Symbol +\n    2: Int64 1\n    3: Int64 1\n  typ: Any"

In 0.4 `dump` did have an ending newline and this change was causing the doctests to indefinitely hang (which was a bug in the doctest system). I have fixed the bug causing the doctests to hang but now the doctests fail due to the manual including an ending newline while the produced output from Julia does not. 

Should I adjust the doctest system to ignore ending whitespace or should I add an ending newline to `dump`?

Tony Kelman

unread,
Jun 25, 2016, 1:41:12 AM6/25/16
to julia-dev
I lean towards adding a newline to dump, especially if it used to be there. I imagine it was probably removed by accident in IO refactorings, not intentionally?
Reply all
Reply to author
Forward
0 new messages