JuliaArrays / PaddedViews.jl

Add virtual padding to the edges of an array
Other
49 stars 9 forks source link

Different output in runtests.jl versus in REPL when prepending padding #57

Open kpa28-git opened 1 year ago

kpa28-git commented 1 year ago

Running PaddedView(missing, 1:7, (-2:7,)) in the REPL outputs this:

10-element PaddedView(missing, ::UnitRange{Int64}, (-2:7,)) with eltype Union{Missing, Int64} with indices -2:7:
  missing
  missing
  missing
 1
 2
 3
 4
 5
 6
 7

This line @show PaddedView(missing, 1:7, (-2:7,)) in a runtests.jl for a package ExamplePackage (where Pkg>test ExamplePackage was used to run tests) shows this (using the latest release of PaddedViews):

PaddedView(missing, 1:7, (-2:7,)) = Union{Missing, Int64}[1, 2, 3, 4, 5, 6, 7, #undef, #undef,
#undef]

This behavior only happens with prepended padding, appended padding outputs the same result in both REPL and runtests.jl:

PaddedView(missing, 1:7, (1:10,)) = Union{Missing, Int64}[1, 2, 3, 4, 5, 6, 7, missing, missing, missing]