23 lines
584 B
Rust
23 lines
584 B
Rust
use alpha_id::segment::split_segments;
|
|
|
|
#[test]
|
|
fn splits_on_blank_lines() {
|
|
let d = "Befund eins\nmit Zeile zwei\n\nBefund zwei\n\n\nBefund drei\n";
|
|
let segs = split_segments(d);
|
|
assert_eq!(segs, vec![
|
|
"Befund eins\nmit Zeile zwei".to_string(),
|
|
"Befund zwei".to_string(),
|
|
"Befund drei".to_string(),
|
|
]);
|
|
}
|
|
|
|
#[test]
|
|
fn single_segment_when_no_blank_line() {
|
|
assert_eq!(split_segments("nur ein Befund"), vec!["nur ein Befund".to_string()]);
|
|
}
|
|
|
|
#[test]
|
|
fn empty_input_yields_no_segments() {
|
|
assert!(split_segments(" \n\n").is_empty());
|
|
}
|