From 4a7f9c1d43c334ab790246e1da0bc43be9a314d4 Mon Sep 17 00:00:00 2001 From: James Kermode Date: Wed, 20 Sep 2023 12:46:21 +0100 Subject: [PATCH] test for issue #37 --- test/atomsbase.jl | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test/atomsbase.jl b/test/atomsbase.jl index a403357..dc09712 100644 --- a/test/atomsbase.jl +++ b/test/atomsbase.jl @@ -113,3 +113,34 @@ Al 0.11095015 0.09471147 -0.05013464 -0.86219000 -0.7 @test atoms[1][:tags] == new_atoms[1][:tags] @test atoms[2][:tags] == new_atoms[2][:tags] end + +@testset "AtomsBase missing cell" begin + fname = tempname() + try + text = """13 + Properties=species:S:1:pos:R:3:forces:R:3 energy=-66.79083251953125 pbc="T T T" + C -5.13553286 0.00000000 0.00000000 0.00006186 -0.00000000 0.00000000 + H -5.72485781 -0.91726500 0.00000000 -0.00001280 0.00000756 0.00000000 + H -5.72485781 0.91726500 0.00000000 -0.00001280 -0.00000756 -0.00000000 + C -3.82464290 0.00000000 0.00000000 -0.00004186 0.00000000 0.00000000 + C -2.55226111 0.00000000 0.00000000 0.00003090 -0.00000000 -0.00000000 + C -1.27494299 0.00000000 0.00000000 -0.00009426 0.00000000 -0.00000000 + C 0.00000000 0.00000000 0.00000000 0.00000000 -0.00000000 -0.00000000 + C 1.27494299 0.00000000 0.00000000 0.00009426 0.00000000 0.00000000 + C 2.55226111 0.00000000 0.00000000 -0.00003090 -0.00000000 0.00000000 + C 3.82464290 0.00000000 0.00000000 0.00004186 0.00000000 -0.00000000 + H 5.72485781 0.00000000 0.91726500 0.00001280 -0.00000000 -0.00000756 + H 5.72485781 0.00000000 -0.91726500 0.00001280 0.00000000 0.00000756 + C 5.13553286 0.00000000 0.00000000 -0.00006186 -0.00000000 -0.00000000 + """ + open(fname, "w") do io + print(io, text) + end + + atoms = ExtXYZ.load(fname) + box = bounding_box(atoms) + @test [box[dim][dim] for dim=1:3] == [Inf * u"bohr" for dim=1:3] + finally + isfile(fname) && rm(fname) + end +end \ No newline at end of file