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.
16 lines
506 B
Rust
16 lines
506 B
Rust
use lawsynth_wasm::{Expression, World};
|
|
#[test]
|
|
fn world_evaluates_a_validated_derivative() {
|
|
let world = World::new(vec!["x".into()], vec![2.0], vec![Expression::parse("-x + t").unwrap()])
|
|
.unwrap();
|
|
assert_eq!(world.derivative_at(3.0, &[2.0]).unwrap(), vec![1.0]);
|
|
assert!(
|
|
World::new(
|
|
vec!["x".into(), "x".into()],
|
|
vec![0.0, 0.0],
|
|
vec![Expression::parse("x").unwrap(), Expression::parse("x").unwrap()]
|
|
)
|
|
.is_err()
|
|
);
|
|
}
|