Skip to content

Commit

Permalink
added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jstrube committed Sep 7, 2020
1 parent a229530 commit 74f9f36
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FastJet"
uuid = "8509a5d2-ae42-11e8-0b46-5d0ace601ee4"
authors = ["Jan Strube <[email protected]>"]
version = "0.6.2"
version = "0.6.3"

[deps]
CxxWrap = "1f15a43c-97ca-5a2a-ae31-89f07a497df4"
Expand All @@ -13,7 +13,7 @@ FastJet_Julia_Wrapper_jll = "33ff6b16-4e4c-5b96-9396-f34816859298"
CxxWrap = "0.11"
julia = "1.4"
FastJet_jll = "~3.3.4"
FastJet_Julia_Wrapper_jll = "0.8.3"
FastJet_Julia_Wrapper_jll = "0.8.4"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
6 changes: 5 additions & 1 deletion src/FastJet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ module FastJet
using FastJet_jll
using CxxWrap
using FastJet_Julia_Wrapper_jll
import Base: getindex

@wrapmodule(libfastjetwrap)

function __init__()
@initcxx
end

export PseudoJet, JetDefinition, antikt_algorithm, ClusterSequence, inclusive_jets, sorted_by_pt, pt, px, py, pz, e, E, rap, phi, constituents, exclusive_jets, modp2, set_user_index, user_index
export PseudoJet, JetDefinition, antikt_algorithm, ClusterSequence, inclusive_jets, sorted_by_pt, pt, px, py, pz, e, E, four_mom, rap, phi, constituents, exclusive_jets, modp2, set_user_index, user_index

getindex(j::PseudoJet, idx) = _getindex(j, idx-1)

end # module
11 changes: 11 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ function main()
jets = inclusive_jets(cs, 0.0)
@test length(jets) == 2
printInfo(jets)
println(FastJet.four_mom(jets[1]))
println(FastJet.four_mom(jets[2]))
end
end
@testset "Plugins" begin
Expand All @@ -59,6 +61,15 @@ function main()
println(FastJet.will_delete_self_when_unused(valencia))
end
p = PseudoJet(3.0, 4.0, 0.0, 25.0)
mom = FastJet.four_mom(p)
@test mom[1] == px(p)
@test mom[2] == py(p)
@test mom[3] == pz(p)
@test mom[4] == E(p)
@test p[1] == px(p)
@test p[2] == py(p)
@test p[3] == pz(p)
@test p[4] == E(p)
set_user_index(p, 17)
@test user_index(p) == 17
@test modp2(p) == 25.0
Expand Down

2 comments on commit 74f9f36

@jstrube
Copy link
Owner Author

@jstrube jstrube commented on 74f9f36 Sep 9, 2020

Choose a reason for hiding this comment

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

@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/21114

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 v0.6.3 -m "<description of version>" 74f9f3694ca111b0a17570fe77a95e9e102259e9
git push origin v0.6.3

Please sign in to comment.