JuliaData / NamedTuples.jl

[DEPRECATED] NamedTuples.jl
Other
30 stars 17 forks source link

fix setindex updates to existing elements of NT #71

Open magerton opened 6 years ago

magerton commented 6 years ago

Fixes setindex so that function can "update" arguments in place and added test. Looks like was an issue with the order of the arguments in merge function. Seems to relate to #40

MWE shows current issue

using NamedTuples
x = @NT(a = 1)
@show setindex(x, :a, 2) # (a=1)
@show merge(@NT(a=2), x) # (a=2) CORRECT!
@show merge(x, @NT(a=2)) # (a=1)
codecov-io commented 6 years ago

Codecov Report

Merging #71 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #71   +/-   ##
=======================================
  Coverage   73.18%   73.18%           
=======================================
  Files           1        1           
  Lines         179      179           
=======================================
  Hits          131      131           
  Misses         48       48
Impacted Files Coverage Δ
src/NamedTuples.jl 73.18% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6353fcc...8621fca. Read the comment docs.