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

nl: fix zero padding of negative line numbers

This commit is contained in:
Daniel Hofstetter 2023-07-19 08:23:23 +02:00
parent e15e03a2bf
commit d7d2ad52db
2 changed files with 48 additions and 53 deletions

View file

@ -114,6 +114,18 @@ fn test_number_format_rz() {
}
}
#[test]
fn test_number_format_rz_with_negative_line_number() {
for arg in ["-nrz", "--number-format=rz"] {
new_ucmd!()
.arg(arg)
.arg("-v-12")
.pipe_in("test")
.succeeds()
.stdout_is("-00012\ttest\n");
}
}
#[test]
fn test_invalid_number_format() {
for arg in ["-ninvalid", "--number-format=invalid"] {