Skip to content

Commit 5fbbfc7

Browse files
committed
csplit: add test for precision syntax
1 parent 0602c19 commit 5fbbfc7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/by-util/test_csplit.rs

+15
Original file line numberDiff line numberDiff line change
@@ -1342,3 +1342,18 @@ fn test_line_num_range_with_up_to_match3() {
13421342
assert_eq!(at.read("xx01"), "");
13431343
assert_eq!(at.read("xx02"), generate(10, 51));
13441344
}
1345+
1346+
#[test]
1347+
fn precision_format() {
1348+
let (at, mut ucmd) = at_and_ucmd!();
1349+
ucmd.args(&["numbers50.txt", "10", "--suffix-format", "%#6.3x"])
1350+
.succeeds()
1351+
.stdout_only("18\n123\n");
1352+
1353+
let count = glob(&at.plus_as_string("xx*"))
1354+
.expect("there should be splits created")
1355+
.count();
1356+
assert_eq!(count, 2);
1357+
assert_eq!(at.read("xx 000"), generate(1, 10));
1358+
assert_eq!(at.read("xx 0x001"), generate(10, 51));
1359+
}

0 commit comments

Comments
 (0)