home ~ projects ~ socials

Testing nom's many1 With rstest In Rust

#[rstest]
#[case("alfa", &["alfa"], "")]
#[case("alfa bravo", &["alfa", " ", "bravo"], "")]
//#[case("  ", "  ", "")]
fn solo_plain_text_string_with_line_spaces_tests(
    #[case] source: &str,
    #[case] got: &[&str],
    #[case] remainder: &str,
) {
    let matcher = (remainder, got.to_vec());
    let parsed = plain_text_string_with_line_spaces(source).unwrap();
    assert_eq!(matcher, parsed);
}
-- end of line --