From eafb62581ca6a1d86af6576b41bf81adba13d7b1 Mon Sep 17 00:00:00 2001 From: zdroid Date: Mon, 3 Aug 2020 16:39:52 +0200 Subject: [PATCH] Use numspecies and numparams in API tests A coverage increase which comes at no additional costs. --- test/api.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/api.jl b/test/api.jl index 2c3697fd5f..593b9874a9 100644 --- a/test/api.jl +++ b/test/api.jl @@ -12,7 +12,7 @@ specset = Set([S.op =>1, I.op => 2, R.op => 3]) pset = Set([k1.op => 1, k2.op => 2]) @test issetequal(pset, paramsmap(rs)) -rxs2 = [Reaction(k2, [I], [R], [1], [1]), +rxs2 = [Reaction(k2, [I], [R], [1], [1]), Reaction(k1, [S,I], [I], [1,1], [2])] rs2 = ReactionSystem(rxs2, t, [R,I,S], [k2,k1]) @test rs == rs2 @@ -43,10 +43,10 @@ rs = ReactionSystem(rxs, t, [S,I,R], [k1,k2]) deps = [s.op for s in dependents(rxs[2], rs)] @test isequal(deps, [R.op,I.op]) addspecies!(rs, Variable(:S)) -@test length(species(rs)) == 3 +@test numspecies(rs) == 3 addspecies!(rs, Variable(:S), disablechecks=true) -@test length(species(rs)) == 4 +@test numspecies(rs) == 4 addparam!(rs, Variable(:k1)) -@test length(params(rs)) == 2 +@test numparams(rs) == 2 addparam!(rs, Variable(:k1), disablechecks=true) -@test length(params(rs)) == 3 \ No newline at end of file +@test numparams(rs) == 3 \ No newline at end of file