Bring the whole workspace into compliance with the repo's rustfmt config (edition 2024, max_width 100, use_small_heuristics = "Max"), which had drifted across many crates. Pure formatting — no logic changes; `cargo fmt --check` is now clean and `cargo build --workspace` is green.
9 lines
402 B
Rust
9 lines
402 B
Rust
use lawsynth_wasm::{Expression, WasmConfig, World, simulate_rk4};
|
|
#[test]
|
|
fn rk4_tracks_exponential_decay() {
|
|
let world =
|
|
World::new(vec!["x".into()], vec![1.0], vec![Expression::parse("-x").unwrap()]).unwrap();
|
|
let trajectory = simulate_rk4(&world, 0.0, 1.0, 0.01, &WasmConfig::default()).unwrap();
|
|
assert!((trajectory.values.last().unwrap()[0] - (-1.0f64).exp()).abs() < 1e-8);
|
|
}
|