mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
uniq: use concat! in tests for better readability
This commit is contained in:
parent
d8e6f36fcb
commit
c85970485a
1 changed files with 37 additions and 7 deletions
|
@ -757,7 +757,10 @@ fn gnu_tests() {
|
||||||
args: &["-D", "-c"],
|
args: &["-D", "-c"],
|
||||||
input: "", // Note: Different from GNU test, but should not matter
|
input: "", // Note: Different from GNU test, but should not matter
|
||||||
stdout: Some(""),
|
stdout: Some(""),
|
||||||
stderr: Some("uniq: printing all duplicated lines and repeat counts is meaningless\nTry 'uniq --help' for more information.\n"),
|
stderr: Some(concat!(
|
||||||
|
"uniq: printing all duplicated lines and repeat counts is meaningless\n",
|
||||||
|
"Try 'uniq --help' for more information.\n"
|
||||||
|
)),
|
||||||
exit: Some(1),
|
exit: Some(1),
|
||||||
},
|
},
|
||||||
TestCase {
|
TestCase {
|
||||||
|
@ -813,7 +816,14 @@ fn gnu_tests() {
|
||||||
args: &["--all-repeated=badoption"],
|
args: &["--all-repeated=badoption"],
|
||||||
input: "", // Note: Different from GNU test, but should not matter
|
input: "", // Note: Different from GNU test, but should not matter
|
||||||
stdout: Some(""),
|
stdout: Some(""),
|
||||||
stderr: Some("uniq: invalid argument 'badoption' for '--all-repeated'\nValid arguments are:\n - 'none'\n - 'prepend'\n - 'separate'\nTry 'uniq --help' for more information.\n"),
|
stderr: Some(concat!(
|
||||||
|
"uniq: invalid argument 'badoption' for '--all-repeated'\n",
|
||||||
|
"Valid arguments are:\n",
|
||||||
|
" - 'none'\n",
|
||||||
|
" - 'prepend'\n",
|
||||||
|
" - 'separate'\n",
|
||||||
|
"Try 'uniq --help' for more information.\n"
|
||||||
|
)),
|
||||||
exit: Some(1),
|
exit: Some(1),
|
||||||
},
|
},
|
||||||
// \x08 is the backspace char
|
// \x08 is the backspace char
|
||||||
|
@ -984,7 +994,10 @@ fn gnu_tests() {
|
||||||
args: &["--group", "-c"],
|
args: &["--group", "-c"],
|
||||||
input: "",
|
input: "",
|
||||||
stdout: Some(""),
|
stdout: Some(""),
|
||||||
stderr: Some("uniq: --group is mutually exclusive with -c/-d/-D/-u\nTry 'uniq --help' for more information.\n"),
|
stderr: Some(concat!(
|
||||||
|
"uniq: --group is mutually exclusive with -c/-d/-D/-u\n",
|
||||||
|
"Try 'uniq --help' for more information.\n"
|
||||||
|
)),
|
||||||
exit: Some(1),
|
exit: Some(1),
|
||||||
},
|
},
|
||||||
TestCase {
|
TestCase {
|
||||||
|
@ -992,7 +1005,10 @@ fn gnu_tests() {
|
||||||
args: &["--group", "-d"],
|
args: &["--group", "-d"],
|
||||||
input: "",
|
input: "",
|
||||||
stdout: Some(""),
|
stdout: Some(""),
|
||||||
stderr: Some("uniq: --group is mutually exclusive with -c/-d/-D/-u\nTry 'uniq --help' for more information.\n"),
|
stderr: Some(concat!(
|
||||||
|
"uniq: --group is mutually exclusive with -c/-d/-D/-u\n",
|
||||||
|
"Try 'uniq --help' for more information.\n"
|
||||||
|
)),
|
||||||
exit: Some(1),
|
exit: Some(1),
|
||||||
},
|
},
|
||||||
TestCase {
|
TestCase {
|
||||||
|
@ -1000,7 +1016,10 @@ fn gnu_tests() {
|
||||||
args: &["--group", "-u"],
|
args: &["--group", "-u"],
|
||||||
input: "",
|
input: "",
|
||||||
stdout: Some(""),
|
stdout: Some(""),
|
||||||
stderr: Some("uniq: --group is mutually exclusive with -c/-d/-D/-u\nTry 'uniq --help' for more information.\n"),
|
stderr: Some(concat!(
|
||||||
|
"uniq: --group is mutually exclusive with -c/-d/-D/-u\n",
|
||||||
|
"Try 'uniq --help' for more information.\n"
|
||||||
|
)),
|
||||||
exit: Some(1),
|
exit: Some(1),
|
||||||
},
|
},
|
||||||
TestCase {
|
TestCase {
|
||||||
|
@ -1008,7 +1027,10 @@ fn gnu_tests() {
|
||||||
args: &["--group", "-D"],
|
args: &["--group", "-D"],
|
||||||
input: "",
|
input: "",
|
||||||
stdout: Some(""),
|
stdout: Some(""),
|
||||||
stderr: Some("uniq: --group is mutually exclusive with -c/-d/-D/-u\nTry 'uniq --help' for more information.\n"),
|
stderr: Some(concat!(
|
||||||
|
"uniq: --group is mutually exclusive with -c/-d/-D/-u\n",
|
||||||
|
"Try 'uniq --help' for more information.\n"
|
||||||
|
)),
|
||||||
exit: Some(1),
|
exit: Some(1),
|
||||||
},
|
},
|
||||||
TestCase {
|
TestCase {
|
||||||
|
@ -1016,7 +1038,15 @@ fn gnu_tests() {
|
||||||
args: &["--group=badoption"],
|
args: &["--group=badoption"],
|
||||||
input: "",
|
input: "",
|
||||||
stdout: Some(""),
|
stdout: Some(""),
|
||||||
stderr: Some("uniq: invalid argument 'badoption' for '--group'\nValid arguments are:\n - 'prepend'\n - 'append'\n - 'separate'\n - 'both'\nTry 'uniq --help' for more information.\n"),
|
stderr: Some(concat!(
|
||||||
|
"uniq: invalid argument 'badoption' for '--group'\n",
|
||||||
|
"Valid arguments are:\n",
|
||||||
|
" - 'prepend'\n",
|
||||||
|
" - 'append'\n",
|
||||||
|
" - 'separate'\n",
|
||||||
|
" - 'both'\n",
|
||||||
|
"Try 'uniq --help' for more information.\n"
|
||||||
|
)),
|
||||||
exit: Some(1),
|
exit: Some(1),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue