use string_sections::prelude::Sections; #[test] fn test_simple() { let doc = r#" Text text text"#; let sections = doc .sections( |line| line.contains(""), ) .collect::>(); assert_eq!(sections.len(), 1); let section = sections[0]; assert_eq!(section.as_str(), "to find"); assert_eq!(section.start_line.as_str(), ""); }