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

csplit: add test for precision syntax

This commit is contained in:
Terts Diepraam 2024-02-10 11:59:41 +01:00
parent 0602c197ff
commit 5fbbfc75de

View file

@ -1342,3 +1342,18 @@ fn test_line_num_range_with_up_to_match3() {
assert_eq!(at.read("xx01"), "");
assert_eq!(at.read("xx02"), generate(10, 51));
}
#[test]
fn precision_format() {
let (at, mut ucmd) = at_and_ucmd!();
ucmd.args(&["numbers50.txt", "10", "--suffix-format", "%#6.3x"])
.succeeds()
.stdout_only("18\n123\n");
let count = glob(&at.plus_as_string("xx*"))
.expect("there should be splits created")
.count();
assert_eq!(count, 2);
assert_eq!(at.read("xx 000"), generate(1, 10));
assert_eq!(at.read("xx 0x001"), generate(10, 51));
}