Commit 30f3426b authored by Miroslav Kratochvil's avatar Miroslav Kratochvil
Browse files

test the rationals

closes #140
parent b00edcbe
# Input files needed when running the tests will be downloaded here
/*.xml
!/custom.xml
......@@ -14,5 +14,14 @@
</listOfUnits>
</unitDefinition>
</listOfUnitDefinitions>
<listOfReactions>
<reaction id="rationalTest" reversible="false" fast="false">
<kineticLaw>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<cn type="rational">1<sep />5000</cn>
</math>
</kineticLaw>
</reaction>
</listOfReactions>
</model>
</sbml>
......@@ -128,7 +128,7 @@ end
@test m.units["time"] == 1 * u"s"
@test m.units["substance"] == 1 * u"mol"
m = readSBML(joinpath(@__DIR__, "data", "units.xml"))
m = readSBML(joinpath(@__DIR__, "data", "custom.xml"))
@test m.units["non_existent"] == 0.00314
@test m.units["no_dimensions"] == 20.0
end
......@@ -174,6 +174,11 @@ end
@test isequal(convert(Num, m.reactions["J29"].kinetic_math), 2.0 * S29 * S29b)
end
@testset "rationals in math" begin
m = readSBML(joinpath(@__DIR__, "data", "custom.xml"))
@test m.reactions["rationalTest"].kinetic_math.val == 1 // 5000
end
@testset "converters work and fail gracefully" begin
@test_logs (:error, r"^SBML reported error:") (:error, r"^SBML reported error:") @test_throws ErrorException readSBML(
joinpath(@__DIR__, "data", "sbml01289.xml"),
......
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