Skip to content

Commit e8b1d8e

Browse files
test: add test to check field equality
1 parent 18855ab commit e8b1d8e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/mtkparameters.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ ivs = Dict(c => 3a, d => 4, e => [5.0, 6.0, 7.0],
1818

1919
ps = MTKParameters(sys, ivs)
2020
@test_nowarn copy(ps)
21+
ps_copy = copy(ps)
22+
ps_field_equals = map(fieldnames(typeof(ps))) do f
23+
getfield(ps, f) == getfield(ps_copy, f)
24+
end
25+
@test all(ps_field_equals)
2126
# dependent initialization, also using defaults
2227
@test getp(sys, a)(ps) == getp(sys, b)(ps) == getp(sys, c)(ps) == 0.0
2328
@test getp(sys, d)(ps) isa Int

0 commit comments

Comments
 (0)