mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
uucore: parse_help_section test section with multiple header
This commit is contained in:
parent
3b54421e9c
commit
154370a0c6
1 changed files with 25 additions and 0 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue