Skip to content

Commit a05103f

Browse files
added an edge case for LatticeReactionSysetm
Signed-off-by: sivasathyaseeelan <[email protected]>
1 parent f13e1a9 commit a05103f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/spatial_modelling/lattice_reaction_systems.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,20 @@ let
215215
end
216216
end
217217

218+
# The second argument must be a vector of AbstractSpatialReaction subtypes.
219+
let
220+
rs = @reaction_network begin
221+
(p,d), 0 <--> X
222+
end
223+
224+
# Define an invalid spatial reaction type (not a subtype of AbstractSpatialReaction)
225+
struct InvalidSpatialReaction end
226+
227+
# Attempt to create the LatticeReactionSystem with InvalidSpatialReaction
228+
lattice = CartesianGrid((5,5))
229+
@test_throws ArgumentError LatticeReactionSystem(rs, [InvalidSpatialReaction()], lattice)
230+
end
231+
218232
# Tests various networks with non-permitted content.
219233
let
220234
tr = @transport_reaction D X

0 commit comments

Comments
 (0)