mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
Add support for starting suffix numbers
This commit now allows split to pass split/numeric.sh
This commit is contained in:
parent
e523a56dab
commit
49e1cc6c71
4 changed files with 244 additions and 160 deletions
|
@ -701,3 +701,29 @@ fn test_multiple_of_input_chunk() {
|
|||
}
|
||||
assert_eq!(glob.collate(), at.read_bytes(name));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_numeric_suffix() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.args(&["-n", "4", "--numeric-suffixes", "9", "threebytes.txt"])
|
||||
.succeeds()
|
||||
.no_stdout()
|
||||
.no_stderr();
|
||||
assert_eq!(at.read("x09"), "a");
|
||||
assert_eq!(at.read("x10"), "b");
|
||||
assert_eq!(at.read("x11"), "c");
|
||||
assert_eq!(at.read("x12"), "");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hex_suffix() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.args(&["-n", "4", "--hex-suffixes", "9", "threebytes.txt"])
|
||||
.succeeds()
|
||||
.no_stdout()
|
||||
.no_stderr();
|
||||
assert_eq!(at.read("x09"), "a");
|
||||
assert_eq!(at.read("x0a"), "b");
|
||||
assert_eq!(at.read("x0b"), "c");
|
||||
assert_eq!(at.read("x0c"), "");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue