From 058b468d33efec95cf3f658c919b3e217f58a54e Mon Sep 17 00:00:00 2001 From: "Michael F. Herbst" Date: Thu, 21 Nov 2024 21:57:53 +0100 Subject: [PATCH] Test file parsing as well --- test/atomsbase.jl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/atomsbase.jl b/test/atomsbase.jl index 2239ee9..e74c335 100644 --- a/test/atomsbase.jl +++ b/test/atomsbase.jl @@ -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