Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonReinhard committed Jun 6, 2024
1 parent 398b6f1 commit 851e1ed
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/QEDbase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export AbstractDiracVector, AbstractDiracMatrix
export mul

export AbstractGammaRepresentation
export gamma

# particle interface
export AbstractParticle
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/lorentz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ With this done, we can aleady register the `CustomType` as a `LorentzVectorLike`
```julia
register_LorentzVectorLike(CustomType)
```
If something goes wrong, this function call will raise an `RegistryError` indicating, what is missing. With this done, `CustomType` is ready to be used as a LorentzVectorLike
If something goes wrong, this function call will raise an `RegistryError` indicating what is missing. With this done, `CustomType` is ready to be used as a `LorentzVectorLike`
```julia
L = CustomType(2.0,1.0,0.0,-1.0)
Expand Down
11 changes: 7 additions & 4 deletions test/interfaces/model.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
using QEDbase

include("../test_implementation/TestImplementation.jl")
struct TestModel <: AbstractModelDefinition end
QEDbase.fundamental_interaction_type(::TestModel) = :test_interaction

struct TestModel_FAIL <: AbstractModelDefinition end

@testset "hard interface" begin
TESTMODEL = TestImplementation.TestModel()
TESTMODEL = TestModel()
@test fundamental_interaction_type(TESTMODEL) == :test_interaction
end

@testset "interface fail" begin
TESTMODEL_FAIL = TestImplementation.TestModel_FAIL()
TESTMODEL_FAIL = TestModel_FAIL()
@test_throws MethodError fundamental_interaction_type(TESTMODEL_FAIL)
end

@testset "broadcast" begin
test_func(model) = model
TESTMODEL = TestImplementation.TestModel()
TESTMODEL = TestModel()
@test test_func.(TESTMODEL) == TESTMODEL
end
1 change: 0 additions & 1 deletion test/test_implementation/test_model.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

struct TestModel <: AbstractModelDefinition end
QEDbase.fundamental_interaction_type(::TestModel) = :test_interaction

Expand Down

0 comments on commit 851e1ed

Please sign in to comment.