Skip to content

Commit

Permalink
cover the new stuff with tests
Browse files Browse the repository at this point in the history
  • Loading branch information
exaexa committed Jan 5, 2025
1 parent 7799d1f commit 5964d21
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions test/writemodels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,20 @@ end
# Make sure that the model we read from the written out file is consistent
# with the original model.
@testset "Round-trip: $(basename(file))" for file in first.(sbmlfiles)
model = readSBML(file)
fix_constant!(model)
remove_some_annotation_strings!(model)
# This is useful for debugging:
# writeSBML(model, file*"-debug.xml")
round_trip_model = readSBMLFromString(@test_logs(writeSBML(model)))
round_trip_model_str = @test_logs writeSBML() do
readSBML(file) do m
fix_constant!(m)
remove_some_annotation_strings!(m)
# This is useful for debugging:
# writeSBML(model, file*"-debug.xml")
return m
end
end

# re-read the unmodified model, fix constantness and compare again
model = readSBML(file)
fix_constant!(model)
@test model == round_trip_model
readSBML(file) do m
fix_constant!(m)
@test m == readSBMLFromString(round_trip_model_str)
end
end
end

0 comments on commit 5964d21

Please sign in to comment.