Skip to content

Commit 4754287

Browse files
authored
Merge pull request #1164 from sivasathyaseeelan/test-LatticeReactionSystem
test: added an edge case for LatticeReactionSystem
2 parents f2f8538 + 1e5d170 commit 4754287

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/spatial_modelling/lattice_reaction_systems.jl

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

218+
# The second argument must be a vector of AbstractSpatialReaction subtypes.
219+
let
220+
# Define an invalid spatial reaction type (not a subtype of AbstractSpatialReaction)
221+
struct InvalidSpatialReactionType end
222+
223+
# Attempt to create the LatticeReactionSystem with InvalidSpatialReactionType
224+
for grid in grids
225+
@test_throws ArgumentError LatticeReactionSystem(binding_system, [], grid)
226+
@test_throws ArgumentError LatticeReactionSystem(binding_system, [InvalidSpatialReactionType()], grid)
227+
end
228+
end
229+
218230
# Tests various networks with non-permitted content.
219231
let
220232
tr = @transport_reaction D X

0 commit comments

Comments
 (0)