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

Merge pull request #3607 from jhscheer/cut_fix_delimiter

cut: fix argument parsing for the delimiter
This commit is contained in:
Sylvestre Ledru 2022-06-11 19:54:48 +02:00 committed by GitHub
commit 3461b6c452
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 5 deletions

View file

@ -172,10 +172,28 @@ fn test_directory_and_no_such_file() {
}
#[test]
fn test_equal_as_delimiter() {
fn test_equal_as_delimiter1() {
new_ucmd!()
.args(&["-f", "2", "-d="])
.pipe_in("--dir=./out/lib")
.succeeds()
.stdout_only("./out/lib\n");
}
#[test]
fn test_equal_as_delimiter2() {
new_ucmd!()
.args(&["-f2", "--delimiter="])
.pipe_in("a=b\n")
.succeeds()
.stdout_only("a=b\n");
}
#[test]
fn test_equal_as_delimiter3() {
new_ucmd!()
.args(&["-f", "1,2", "-d", "''", "--output-delimiter=Z"])
.pipe_in("ab\0cd\n")
.succeeds()
.stdout_only_bytes("abZcd\n");
}