Skip to content

Commit

Permalink
join: test whitespace merging
Browse files Browse the repository at this point in the history
  • Loading branch information
jtracey committed Sep 28, 2024
1 parent c6cff91 commit 879e1ea
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/by-util/test_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,25 @@ fn default_arguments() {
.stdout_only_fixture("default.expected");
}

#[test]
fn only_whitespace_separators_merge() {
new_ucmd!()
.arg("contiguous_separators.txt")
.arg("-")
.pipe_in(" a ,c ")
.succeeds()
.stdout_only("a ,,,b ,c \n");

new_ucmd!()
.arg("contiguous_separators.txt")
.arg("-t")
.arg(",")
.arg("-")
.pipe_in(" a ,c ")
.succeeds()
.stdout_only(" a ,,,b,c \n");
}

#[test]
fn different_fields() {
new_ucmd!()
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/join/contiguous_separators.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a ,,,b

0 comments on commit 879e1ea

Please sign in to comment.