Skip to content

Commit c5e784e

Browse files
elehcimislent
authored andcommitted
Add test on filter on particle Collection using getingex
Related to: JuliaAstroSim/PhysicalParticles.jl#22
1 parent b96b441 commit c5e784e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/runtests.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ header, data = read_gadget2("gassphere_littleendian.gadget2") # 1472 gas particl
2323
h, d = read_gadget2("gadget2.format2")
2424
@test h.npart[1] == 1472
2525

26+
# getindex
27+
for i in instances(Collection)
28+
@test length(d[i]) == h.npart[Int(i)]
29+
end
30+
2631
pos = read_gadget2_pos("gadget2.format2")
2732
@test length(pos) == 1472
2833
@test pos[1] == PVector(-0.07133729010820389*u"kpc", -0.35668644309043884*u"kpc", -0.9273847341537476*u"kpc")

0 commit comments

Comments
 (0)