1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +00:00

uucore: parse_help_section test section with multiple header

This commit is contained in:
Piotr Kwiecinski 2023-03-22 16:57:41 +01:00
parent 3b54421e9c
commit 154370a0c6

View file

@ -255,6 +255,31 @@ mod tests {
);
}
#[test]
fn section_parsing_with_additional_headers() {
let input = "\
# ls\n\
## after section\n\
This is some section\n\
\n\
### level 3 header\n\
\n\
Additional text under the section.\n\
\n\
#### level 4 header\n\
\n\
Yet another paragraph\n";
assert_eq!(
parse_help_section("after section", input),
"This is some section\n\n\
### level 3 header\n\n\
Additional text under the section.\n\n\
#### level 4 header\n\n\
Yet another paragraph"
);
}
#[test]
#[should_panic]
fn section_parsing_panic() {