Skip to content

Commit

Permalink
revised unit tests for pretty printing, properly trigger show
Browse files Browse the repository at this point in the history
  • Loading branch information
johnzl-777 committed Jan 11, 2024
1 parent a4afb98 commit 56cd277
Showing 1 changed file with 39 additions and 10 deletions.
49 changes: 39 additions & 10 deletions test/show.jl
Original file line number Diff line number Diff line change
@@ -1,21 +1,50 @@
# show solver and report

using DormandPrince
using Test

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
)
@testset "Successful Options Check with Successful Integration" begin
solver = DP5Solver(
stiff_fcn,
0.0,
[0.0001]
)

show(solver)
show(stdout, MIME"text/plain"(), solver)

report = DormandPrince.integrate_core!(solver, 2/0.0001)
report = DormandPrince.integrate_core!(solver, 2/0.0001)

show(report)
show(stdout, MIME"text/plain"(), report)

end

@testset "Successful Options Check with Failed Integration" begin
solver = DP5Solver(
stiff_fcn,
0.0,
[0.0001];
maximum_allowed_steps=10 #
)

report = DormandPrince.integrate_core!(solver, 2/0.0001)

show(stdout, MIME"text/plain"(), report)
end

@testset "Failed Options Check" begin
solver = DP5Solver(
stiff_fcn,
0.0,
[0.0001];
uround = 100
)

report = DormandPrince.integrate_core!(solver, 2/0.0001)

show(stdout, MIME"text/plain"(), report)

end

0 comments on commit 56cd277

Please sign in to comment.