Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
cpmech committed May 20, 2024
1 parent 18851e5 commit bb1ad39
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions russell_ode/src/ode_solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit bb1ad39

Please sign in to comment.