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

join: implement the -t option

This commit is contained in:
Konstantin Pospelov 2017-12-24 16:22:48 +03:00
parent c27edbb73f
commit 4e0a0cf7bb
5 changed files with 110 additions and 45 deletions

View file

@ -0,0 +1,6 @@
1; a
2 ;b
3; c
4 ;d
5; e
6 ;f

View file

@ -0,0 +1,3 @@
2 ;x
3; y
4 ;z

View file

@ -0,0 +1,4 @@
2 ;b;x
3; c; y
4 ;d;z

View file

@ -93,3 +93,34 @@ fn case_insensitive() {
.arg("-i")
.succeeds().stdout_only_fixture("case_insensitive.expected");
}
#[test]
fn semicolon_separated() {
new_ucmd!()
.arg("semicolon_fields_1.txt")
.arg("semicolon_fields_2.txt")
.arg("-t")
.arg(";")
.succeeds().stdout_only_fixture("semicolon_separated.expected");
}
#[test]
fn new_line_separated() {
new_ucmd!()
.arg("-")
.arg("fields_2.txt")
.arg("-t")
.arg("")
.pipe_in("1 a\n1 b\n8 h\n")
.succeeds().stdout_only("1 a\n8 h");
}
#[test]
fn multitab_character() {
new_ucmd!()
.arg("semicolon_fields_1.txt")
.arg("semicolon_fields_2.txt")
.arg("-t")
.arg("э")
.fails().stderr_is("join: error: multi-character tab э");
}