Commit 52a28006 authored by Miroslav Kratochvil's avatar Miroslav Kratochvil
Browse files

add tests for the 2param math functions

parent 951bf82b
......@@ -57,7 +57,7 @@ const default_symbolics_mapping = Dict{String,Any}(
)
sbmlLog(x) = log(x, 10)
sbmlLog(base, x) = log(x, base)
sbmlLog(base, x) = log(base, x)
sbmlRoot(x) = sqrt(x)
sbmlRoot(power, x) = x^(1 / power)
......
......@@ -40,6 +40,14 @@ sbmlfiles = [
4,
2,
),
# this contains some special math
(
joinpath(@__DIR__, "data", "sbml01565.xml"),
"https://raw.githubusercontent.com/sbmlteam/sbml-test-suite/master/cases/semantic/01565/01565-sbml-l3v1.xml",
"14a80fbce316eea2adb566f67b4668ad151db8954e487309852ece7f730c8c99",
104,
52,
),
]
@testset "Loading of models from various sources" begin
......@@ -108,3 +116,12 @@ end
@test subterm.args[1] == SBML.MathIdent("S1")
@test isapprox(subterm.args[2].val, 1.0)
end
@testset "logBase and root math functions" begin
m = readSBML(joinpath(@__DIR__, "data", "sbml01565.xml"))
@test convert(Num, m.reactions["J23"].kinetic_math) == 0.0
@variables S29 S29b
@test isequal(convert(Num, m.reactions["J29"].kinetic_math), 2.0 * S29 * S29b)
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment