Skip to content

Commit

Permalink
Merge pull request #41 from libAtoms/issue37-2
Browse files Browse the repository at this point in the history
test for issue #37
  • Loading branch information
jameskermode committed Sep 20, 2023
2 parents 4e05766 + 4a7f9c1 commit 1536e57
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/atomsbase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1536e57

Please sign in to comment.