@@ -19,18 +19,29 @@ e = PGP.Ellipse()
1919t = PGP. Triangle ()
2020
2121PGP. add_property! (r, :prop , D. bar ())
22- eltype (PGP. properties (r)[:prop ]) == D. bar
22+ @test eltype (PGP. properties (r)[:prop ]) == D. bar
2323PGP. add! (r, e, prop = D. foo ())
24- eltype (PGP. properties (r)[:prop ]) == Union{D. bar, D. foo}
24+ @test eltype (PGP. properties (r)[:prop ]) == Union{D. bar, D. foo}
2525PGP. add! (r, t, prop = D. oomp ())
26- eltype (PGP. properties (r)[:prop ]) == Union{D. bar, D. foo, D. oomp}
26+ @test eltype (PGP. properties (r)[:prop ]) == Union{D. bar, D. foo, D. oomp}
2727
2828
29- # Merging properties of two meshes
29+ # Merging meshes
30+ # Make sure property unions are created
3031PGP. add_property! (e, :prop , D. foo ())
3132PGP. add_property! (t, :prop , D. bar ())
3233m = PGP. Mesh ([t, e])
33- eltype (PGP. properties (m)[:prop ]) == Union{D. bar, D. foo}
34-
34+ @test eltype (PGP. properties (m)[:prop ]) == Union{D. bar, D. foo}
35+ @test eltype (PGP. properties (e)[:prop ]) == D. foo
36+ @test eltype (PGP. properties (t)[:prop ]) == D. bar
37+ # Make sure original meshes are not modified
38+ l1 = length (PGP. properties (e)[:prop ])
39+ l2 = length (PGP. properties (t)[:prop ])
40+ l3 = length (PGP. properties (m)[:prop ])
41+ @test l1 + l2 == l3
42+ nv1 = PGP. nvertices (e)
43+ nv2 = PGP. nvertices (t)
44+ nv3 = PGP. nvertices (m)
45+ @test nv1 + nv2 == nv3
3546
3647end
0 commit comments