Skip to content

Commit

Permalink
Merge pull request #4707 from cakebaker/wc_improve_readability_of_tests
Browse files Browse the repository at this point in the history
wc: use concat! to improve readability of tests
  • Loading branch information
sylvestre authored Apr 4, 2023
2 parents a778786 + b8eb9d3 commit 9060904
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions tests/by-util/test_wc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,24 +475,31 @@ fn test_total_auto() {
new_ucmd!()
.args(&["lorem_ipsum.txt", "moby_dick.txt", "--total=auto"])
.run()
.stdout_is(
" 13 109 772 lorem_ipsum.txt\n 18 204 1115 moby_dick.txt\n 31 313 1887 total\n",
);
.stdout_is(concat!(
" 13 109 772 lorem_ipsum.txt\n",
" 18 204 1115 moby_dick.txt\n",
" 31 313 1887 total\n",
));
}

#[test]
fn test_total_always() {
new_ucmd!()
.args(&["lorem_ipsum.txt", "--total=always"])
.run()
.stdout_is(" 13 109 772 lorem_ipsum.txt\n 13 109 772 total\n");
.stdout_is(concat!(
" 13 109 772 lorem_ipsum.txt\n",
" 13 109 772 total\n",
));

new_ucmd!()
.args(&["lorem_ipsum.txt", "moby_dick.txt", "--total=always"])
.run()
.stdout_is(
" 13 109 772 lorem_ipsum.txt\n 18 204 1115 moby_dick.txt\n 31 313 1887 total\n",
);
.stdout_is(concat!(
" 13 109 772 lorem_ipsum.txt\n",
" 18 204 1115 moby_dick.txt\n",
" 31 313 1887 total\n",
));
}

#[test]
Expand All @@ -505,7 +512,10 @@ fn test_total_never() {
new_ucmd!()
.args(&["lorem_ipsum.txt", "moby_dick.txt", "--total=never"])
.run()
.stdout_is(" 13 109 772 lorem_ipsum.txt\n 18 204 1115 moby_dick.txt\n");
.stdout_is(concat!(
" 13 109 772 lorem_ipsum.txt\n",
" 18 204 1115 moby_dick.txt\n",
));
}

#[test]
Expand Down

0 comments on commit 9060904

Please sign in to comment.