Skip to content

Commit f1d1b9b

Browse files
committed
tests
1 parent a69357b commit f1d1b9b

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

test/reactionsystem_core/reactionsystem.jl

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,3 +816,42 @@ end
816816
let
817817
@test_nowarn Catalyst.reactionsystem_uptodate_check()
818818
end
819+
820+
# Test that functions using the incidence matrix properly cache it
821+
let
822+
rn = @reaction_network begin
823+
k1, A --> B
824+
k2, B --> C
825+
k3, C --> A
826+
end
827+
828+
nps = Catalyst.get_networkproperties(rn)
829+
@test isempty(nps.incidencemat) == true
830+
831+
img = incidencematgraph(rn)
832+
@test size(nps.incidencemat) == (3,3)
833+
834+
Catalyst.reset!(nps)
835+
lcs = linkageclasses(rn)
836+
@test size(nps.incidencemat) == (3,3)
837+
838+
Catalyst.reset!(nps)
839+
sns = subnetworks(rn)
840+
@test size(nps.incidencemat) == (3,3)
841+
842+
Catalyst.reset!(nps)
843+
δ = deficiency(rn)
844+
@test size(nps.incidencemat) == (3,3)
845+
846+
Catalyst.reset!(nps)
847+
δ_l = linkagedeficiencies(rn)
848+
@test size(nps.incidencemat) == (3,3)
849+
850+
Catalyst.reset!(nps)
851+
rev = isreversible(rn)
852+
@test size(nps.incidencemat) == (3,3)
853+
854+
Catalyst.reset!(nps)
855+
weakrev = isweaklyreversible(rn, sns)
856+
@test size(nps.incidencemat) == (3,3)
857+
end

0 commit comments

Comments
 (0)