From 19b89d48d1e31a5f434e5564de2a86a06190ec3a Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 31 Dec 2023 16:54:09 -0500 Subject: [PATCH] Fix test --- test/integrators/verner.jl | 8 ++++---- test/interface/saveat.jl | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/test/integrators/verner.jl b/test/integrators/verner.jl index 2467bf0..e4f7514 100644 --- a/test/integrators/verner.jl +++ b/test/integrators/verner.jl @@ -20,7 +20,7 @@ using Test sol_scalar = solve(prob_scalar, alg) # fails due to floating point issues - @test sol_ip(ts, idxs = 1) ≈ sol_scalar(ts) + @test sol_ip(ts, idxs = 1) ≈ sol_scalar(ts) atol=1e-5 end # Vern7 @@ -35,7 +35,7 @@ using Test sol_scalar = solve(prob_scalar, alg) - @test sol_ip(ts, idxs = 1) ≈ sol_scalar(ts) + @test sol_ip(ts, idxs = 1) ≈ sol_scalar(ts) atol=1e-5 end # Vern8 @@ -50,7 +50,7 @@ using Test sol_scalar = solve(prob_scalar, alg) - @test sol_ip(ts, idxs = 1) ≈ sol_scalar(ts) + @test sol_ip(ts, idxs = 1) ≈ sol_scalar(ts) atol=1e-5 end # Vern9 @@ -65,7 +65,7 @@ using Test sol_scalar = solve(prob_scalar, alg) - @test sol_ip(ts, idxs = 1) ≈ sol_scalar(ts) + @test sol_ip(ts, idxs = 1) ≈ sol_scalar(ts) atol=1e-5 end end diff --git a/test/interface/saveat.jl b/test/interface/saveat.jl index 0730da9..f30c5e0 100644 --- a/test/interface/saveat.jl +++ b/test/interface/saveat.jl @@ -64,7 +64,7 @@ end # time point of solution if saveat isa Number - @test sol2.t == [0.0, 25.0, 50.0, 75.0, 100.0] + @test sol2.t == (save_end ? [0.0, 25.0, 50.0, 75.0, 100.0] : [0.0, 25.0, 50.0, 75.0]) else @test sol2.t == (save_end ? [25.0, 50.0, 75.0, 100.0] : [25.0, 50.0, 75.0]) end @@ -116,7 +116,8 @@ end @test sol2.u == dde_int2.sol.u # time points of solution - @test symdiff(sol.t, sol2.t) == [25.0, 50.0, 75.0] + @test symdiff(sol.t, sol2.t) == + (save_end ? [25.0, 50.0, 75.0] : [100.0, 25.0, 50.0, 75.0]) # history is equal to solution above @test sol.t == dde_int2.integrator.sol.t @@ -148,5 +149,5 @@ end MethodOfSteps(Tsit5()), saveat = _saveat, save_end = false) add_tstop!(integ, 2.0) solve!(integ) - @test integ.sol.t == _saveat + @test integ.sol.t == [0.0, 0.25, 0.5] end