From bb1ad39350eba6e9d8653da4c5e0c549f15346b7 Mon Sep 17 00:00:00 2001 From: Dorival Pedroso Date: Tue, 21 May 2024 09:39:16 +1000 Subject: [PATCH] Improve test --- russell_ode/src/ode_solver.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/russell_ode/src/ode_solver.rs b/russell_ode/src/ode_solver.rs index f150e770..60edb602 100644 --- a/russell_ode/src/ode_solver.rs +++ b/russell_ode/src/ode_solver.rs @@ -706,13 +706,9 @@ mod tests { solver.enable_output().set_step_recording(&[0]); // solve and stop due to error on the first accepted step - solver.enable_output().set_step_callback(|stats, _h, _x, _y, _args| { - if stats.n_accepted == 0 { - Err("stop with error (first accepted step)") - } else { - Ok(false) // do not stop - } - }); + solver + .enable_output() + .set_step_callback(|_stats, _h, _x, _y, _args| Err("stop with error (first accepted step)")); let mut y = y0.clone(); assert_eq!( solver.solve(&mut y, 0.0, 0.4, None, &mut args).err(),