Skip to content

Commit

Permalink
Fix system comparison edge case (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfherbst committed Aug 10, 2023
1 parent 9c43870 commit a0633ff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/AtomsBaseTesting/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AtomsBaseTesting"
uuid = "ed7c10db-df7e-4efa-a7be-4f4190f7f227"
authors = ["JuliaMolSim community"]
version = "0.1.1"
version = "0.1.2"

[deps]
AtomsBase = "a963bdd2-2df7-4f54-a1ee-49d51e6be12a"
Expand Down
1 change: 1 addition & 0 deletions lib/AtomsBaseTesting/src/AtomsBaseTesting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function test_approx_eq(s::AbstractSystem, t::AbstractSystem;
@test haskey(s, prop) == haskey(t, prop)
continue
end
(haskey(s, prop) && haskey(t, prop)) || continue

if s[prop] isa Quantity
@test rnorm(s[prop], t[prop]) < rtol
Expand Down
5 changes: 5 additions & 0 deletions lib/AtomsBaseTesting/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,10 @@ include("testmacros.jl")
@testpass test_approx_eq(system, system_edit; common_only=true)
end

@testset "Identical systems without multiplicity" begin
case = make_test_system(; drop_sysprop=[:multiplicity])
@testpass test_approx_eq(case.system, case.system)
end

# TODO More tests would be useful
end

2 comments on commit a0633ff

@mfherbst
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register subdir=lib/AtomsBaseTesting

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/89404

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a AtomsBaseTesting-v0.1.2 -m "<description of version>" a0633ff934b350c6952b77270ffdef89db11501e
git push origin AtomsBaseTesting-v0.1.2

Please sign in to comment.