DoctorDocstrings.jl icon indicating copy to clipboard operation
DoctorDocstrings.jl copied to clipboard

doctests will fail if REPL history evaluations aren't printed as well

Open miguelraz opened this issue 4 years ago • 2 comments

there is a difference between pasting the desired behaviour of

julia> 3+3
6

vs what currently gets pasted - only the REPL history

julia> 3+3

which omits the result, and will fail the doctest pass. This is bad.

miguelraz avatar Dec 17 '20 21:12 miguelraz

Hitting a likely macro hygiene bug. https://www.youtube.com/watch?v=JePBb9-ychE

miguelraz avatar Dec 18 '20 00:12 miguelraz

here's how to reproduce https://discourse.julialang.org/t/ann-announcing-doctordocstrings-jl/51999/8?u=miguelraz

julia> using SparseArrays

julia> A = sparsevec([1,2,3], [1.0, 0.0, 1.0])
3-element SparseVector{Float64, Int64} with 3 stored entries:
  [1]  =  1.0
  [2]  =  0.0
  [3]  =  1.0

julia> dropzeros!(A)
3-element SparseVector{Float64, Int64} with 2 stored entries:
  [1]  =  1.0
  [3]  =  1.0

pickandcopy() those 3 to get

sparsevec not defined

.

miguelraz avatar Dec 18 '20 01:12 miguelraz