-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix input type assembling * Add test file
- Loading branch information
1 parent
0ea9ca9
commit dd3c037
Showing
3 changed files
with
60 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# file for testing that the generated input_type of a generated dag is correct | ||
|
||
using Random | ||
using QEDcore | ||
using QEDprocesses | ||
using ComputableDAGs | ||
using QEDFeynmanDiagrams | ||
|
||
using RuntimeGeneratedFunctions | ||
RuntimeGeneratedFunctions.init(@__MODULE__) | ||
|
||
include("utils.jl") | ||
|
||
RNG = MersenneTwister(0) | ||
|
||
@testset "Compton-like process with $n incoming photons" for n in (1, 2, 3, 4) | ||
proc = ScatteringProcess( | ||
(Electron(), ntuple(_ -> Photon(), n)...), | ||
(Electron(), Photon()), | ||
(AllSpin(), ntuple(_ -> PolX(), n)...), | ||
(AllSpin(), AllPol()), | ||
) | ||
|
||
for n_other in (1, 2, 3, 4) | ||
n_other_proc = ScatteringProcess( | ||
(Electron(), ntuple(_ -> Photon(), n_other)...), | ||
(Electron(), Photon()), | ||
(AllSpin(), ntuple(_ -> PolX(), n_other)...), | ||
(AllSpin(), AllPol()), | ||
) | ||
input = gen_process_input(RNG, n_other_proc) | ||
|
||
if n_other == n | ||
@test typeof(input) <: input_type(proc) | ||
else | ||
@test !(typeof(input) <: input_type(proc)) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
using SafeTestsets | ||
|
||
@safetestset "Input Type" begin | ||
include("input_type.jl") | ||
end | ||
|
||
@safetestset "Synced Spins and Polarizations" begin | ||
include("synced_spin_pol.jl") | ||
end |