Skip to content

Commit

Permalink
test nominal for struct
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Nov 21, 2020
1 parent 20fa914 commit cdad6c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/nominal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Return the nominal value of `p` (assumes that `p` has bee endowed with a nominal
"""
nominal(p::AbstractParticles) = p[1]
nominal(p::MvParticles) = nominal.(p)
nominal(P) = replace_particles(P, replacer=P->nominal(P))
nominal(P) = replace_particles(P, replacer=nominal)
5 changes: 4 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,10 @@ Random.seed!(0)
pn = with_nominal(p, n)
@test nominal(pn) == getindex.(pn, 1) == n
@test nominal(p) != n


P = complex(1 ± 0.1, 2 ± 0.1)
@test nominal(P) == complex(real(P)[1], imag(P)[1])

end

include("test_unitful.jl")
Expand Down

0 comments on commit cdad6c1

Please sign in to comment.