Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonReinhard committed Jun 19, 2024
1 parent 1548437 commit 1492bd8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/particles/spinors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ end

const SpinorVbar = IncomingAntiFermionSpinor

function getindex(SP::T, idx) where {T<:QEDbase.AbstractParticleSpinor}
return idx in (1, 2) ? SP(idx) : throw(BoundsError())
end
# TODO: reenable when it's no longer in QEDbase
# function getindex(SP::T, idx) where {T<:QEDbase.AbstractParticleSpinor}
# return idx in (1, 2) ? SP(idx) : throw(BoundsError())
# end
4 changes: 4 additions & 0 deletions test/particles/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ using QEDbase
using StaticArrays
using Random

# TODO this can be deleted when QEDbase is released again
# fix for the broadcast tests
Base.broadcastable(part::QEDbase.AbstractParticleType) = Ref(part)

# test function to test scalar broadcasting
test_broadcast(x::AbstractParticle) = x
test_broadcast(x::ParticleDirection) = x
Expand Down

0 comments on commit 1492bd8

Please sign in to comment.