Skip to content

Commit 2d5f9e0

Browse files
committed
test nominal for struct
1 parent 13a553a commit 2d5f9e0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/nominal.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ Return the nominal value of `p` (assumes that `p` has bee endowed with a nominal
3535
"""
3636
nominal(p::AbstractParticles) = p[1]
3737
nominal(p::MvParticles) = nominal.(p)
38-
nominal(P) = replace_particles(P, replacer=P->nominal(P))
38+
nominal(P) = replace_particles(P, replacer=nominal)

test/runtests.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,10 @@ Random.seed!(0)
787787
pn = with_nominal(p, n)
788788
@test nominal(pn) == getindex.(pn, 1) == n
789789
@test nominal(p) != n
790-
790+
791+
P = complex(1 ± 0.1, 2 ± 0.1)
792+
@test nominal(P) == complex(real(P)[1], imag(P)[1])
793+
791794
end
792795

793796
include("test_unitful.jl")

0 commit comments

Comments
 (0)