From 9c04b238cb72766acee77e4d99f027d842262a7c Mon Sep 17 00:00:00 2001 From: Torkel Loman Date: Sun, 17 Nov 2024 16:10:13 +0000 Subject: [PATCH] add programmtic comaprison to tests --- test/dsl/dsl_options.jl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/test/dsl/dsl_options.jl b/test/dsl/dsl_options.jl index bc45642780..02b618908c 100644 --- a/test/dsl/dsl_options.jl +++ b/test/dsl/dsl_options.jl @@ -566,6 +566,7 @@ let end # Checks that models created w/o specifying `@variables` for observables are identical. +# Compares both to model with explicit declaration, and programmatically created model. let # With default ivs. rn1 = @reaction_network rn begin @@ -576,22 +577,31 @@ let @variables X1(t) X2(t) @observables X ~ X1 + X2 end + @variables X(t) X1(t) X2(t) + rn3 = complete(ReactionSystem([], t, [X1, X2], []; name = :rn, observed = [X ~ X1 + X2])) @test isequal(rn1, rn2) + @test isequal(rn1, rn3) @test isequal(rn1.X, rn2.X) + @test isequal(rn1.X, rn3.X) # With non-default ivs. - rn3 = @reaction_network rn begin + rn4 = @reaction_network rn begin @ivs τ x @variables X(τ,x) X1(τ,x) X2(τ,x) @observables X ~ X1 + X2 end - rn4 = @reaction_network rn begin + rn5 = @reaction_network rn begin @ivs τ x @variables X1(τ,x) X2(τ,x) @observables X ~ X1 + X2 end - @test isequal(rn3, rn4) - @test isequal(rn3.X, rn4.X) + @parameters τ x + @variables X(τ,x) X1(τ,x) X2(τ,x) + rn6 = complete(ReactionSystem([], τ, [X1, X2], []; name = :rn, observed = [X ~ X1 + X2], spatial_ivs = [x])) + @test isequal(rn4, rn5) + @test isequal(rn4, rn6) + @test isequal(rn4.X, rn5.X) + @test isequal(rn4.X, rn6.X) end # Checks that ivs are correctly found.