1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 03:26:18 +00:00

Merge pull request #6094 from sargas/fmt-small-widths

fmt: Make sure goal is always positive
This commit is contained in:
Daniel Hofstetter 2024-03-19 16:55:10 +01:00 committed by GitHub
commit 7c8dfca4a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 25 additions and 11 deletions

View file

@ -33,7 +33,19 @@ fn test_fmt_width() {
new_ucmd!()
.args(&["one-word-per-line.txt", param, "10"])
.succeeds()
.stdout_is("this is\na file\nwith one\nword per\nline\n");
.stdout_is("this is a\nfile with\none word\nper line\n");
}
}
#[test]
fn test_small_width() {
for width in ["0", "1", "2", "3"] {
for param in ["-w", "--width"] {
new_ucmd!()
.args(&[param, width, "one-word-per-line.txt"])
.succeeds()
.stdout_is("this\nis\na\nfile\nwith\none\nword\nper\nline\n");
}
}
}