lawsynth/crates/lawsynth-regime/tests/segmentation_unit.rs
caelum0x 8af85c6e28 style: format workspace to rustfmt.toml (use_small_heuristics = Max)
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.
2026-08-18 16:59:40 +03:00

9 lines
357 B
Rust

use lawsynth_regime::{SegmentationConfig, pelt};
#[test]
fn pelt_finds_clear_level_change() {
let values = [0.0, 0.1, -0.1, 0.0, 0.05, 5.0, 5.1, 4.9, 5.0, 5.05];
let result = pelt(&values, SegmentationConfig { penalty: 1.0, min_segment_len: 3 }).unwrap();
assert_eq!(result.change_points(), vec![5]);
assert_eq!(result.segments.len(), 2);
}