From a4afb98b244b39c0b4dbea1ec90a90d3ce331cc3 Mon Sep 17 00:00:00 2001 From: John Long Date: Thu, 11 Jan 2024 12:00:55 -0500 Subject: [PATCH] Attempt unit tests for pretty printing --- test/runtests.jl | 4 ++++ test/show.jl | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 test/show.jl diff --git a/test/runtests.jl b/test/runtests.jl index d2b2742..a8100c3 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -18,4 +18,8 @@ end @testset "Error Paths" begin include("errors.jl") +end + +@testset "Pretty Printing" begin + include("show.jl") end \ No newline at end of file diff --git a/test/show.jl b/test/show.jl new file mode 100644 index 0000000..49f97c8 --- /dev/null +++ b/test/show.jl @@ -0,0 +1,21 @@ +# show solver and report + +using DormandPrince + +function stiff_fcn(x, y, f) + f[1] = y[1]^2 - y[1]^3 +end + +solver = DP5Solver( + stiff_fcn, + 0.0, + [0.0001] + ; + maximum_allowed_steps=100 +) + +show(solver) + +report = DormandPrince.integrate_core!(solver, 2/0.0001) + +show(report) \ No newline at end of file