dump missing trailing newline

瀏覽次數:78 次
跳到第一則未讀訊息

Curtis Vogt

未讀,
2016年6月24日 晚上7:56:222016/6/24
收件者: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

未讀,
2016年6月25日 凌晨1:41:122016/6/25
收件者: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?
回覆所有人
回覆作者
轉寄
0 則新訊息