Skip to content

Commit

Permalink
Test file parsing as well
Browse files Browse the repository at this point in the history
  • Loading branch information
mfherbst committed Nov 21, 2024
1 parent d0c8335 commit 058b468
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/atomsbase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,17 @@ using UnitfulAtomic
test_approx_eq(system, newsystem;
rtol=1e-12, ignore_atprop=[:covalent_radius, :vdw_radius])
end

@testset "Make sure the example data files can be parsed" begin
import AtomsBase
using AtomsBase: AbstractSystem, FlexibleSystem

const DATAPATH = joinpath(@__DIR__, "data")
for file in ["empty.unknown", "topology.xyz", "water.xyz"]
traj = Chemfiles.Trajectory(joinpath(DATAPATH, file))
frame = Chemfiles.read_step(traj, 1)
sys = convert(FlexibleSystem, traj)
@test length(sys) == length(frame)
end
end
end

0 comments on commit 058b468

Please sign in to comment.