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

nl: support --join-blank-lines over multiple files

This commit is contained in:
Daniel Hofstetter 2023-09-19 10:47:20 +02:00
parent 1107fadca9
commit 1a30a1b8b6
2 changed files with 28 additions and 4 deletions

View file

@ -284,6 +284,31 @@ fn test_join_blank_lines() {
}
}
#[test]
fn test_join_blank_lines_multiple_files() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
at.write("a.txt", "\n\n");
at.write("b.txt", "\n\n");
at.write("c.txt", "\n\n");
for arg in ["-l3", "--join-blank-lines=3"] {
scene
.ucmd()
.args(&[arg, "--body-numbering=a", "a.txt", "b.txt", "c.txt"])
.succeeds()
.stdout_is(concat!(
" \n",
" \n",
" 1\t\n",
" \n",
" \n",
" 2\t\n",
));
}
}
#[test]
fn test_join_blank_lines_zero() {
for arg in ["-l0", "--join-blank-lines=0"] {