mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
tests/util: Do not trim stderr in CmdResult::stderr_is. Add method stderr_trimmed_is.
Fix tests assert whitespace instead of trimming it. Disable some tests in `test_tr` because `tr` produces too many newlines.
This commit is contained in:
parent
7c0ed0340b
commit
1fadeb43b2
40 changed files with 229 additions and 211 deletions
|
@ -206,7 +206,7 @@ fn tab_multi_character() {
|
|||
.arg("-t")
|
||||
.arg("э")
|
||||
.fails()
|
||||
.stderr_is("join: multi-character tab э");
|
||||
.stderr_is("join: multi-character tab э\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -282,7 +282,7 @@ fn empty_format() {
|
|||
.arg("-o")
|
||||
.arg("")
|
||||
.fails()
|
||||
.stderr_is("join: invalid file number in field spec: ''");
|
||||
.stderr_is("join: invalid file number in field spec: ''\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -332,7 +332,7 @@ fn wrong_line_order() {
|
|||
.fails()
|
||||
.stdout_contains("7 g f 4 fg")
|
||||
.stderr_is(&format!(
|
||||
"{0} {1}: fields_4.txt:5: is not sorted: 11 g 5 gh\n{0} {1}: input is not in sorted order",
|
||||
"{0} {1}: fields_4.txt:5: is not sorted: 11 g 5 gh\n{0} {1}: input is not in sorted order\n",
|
||||
ts.bin_path.to_string_lossy(),
|
||||
ts.util_name
|
||||
));
|
||||
|
@ -344,7 +344,7 @@ fn wrong_line_order() {
|
|||
.fails()
|
||||
.stdout_does_not_contain("7 g f 4 fg")
|
||||
.stderr_is(&format!(
|
||||
"{0}: fields_4.txt:5: is not sorted: 11 g 5 gh",
|
||||
"{0}: fields_4.txt:5: is not sorted: 11 g 5 gh\n",
|
||||
ts.util_name
|
||||
));
|
||||
}
|
||||
|
@ -358,7 +358,7 @@ fn both_files_wrong_line_order() {
|
|||
.fails()
|
||||
.stdout_contains("5 e 3 ef")
|
||||
.stderr_is(&format!(
|
||||
"{0} {1}: fields_5.txt:4: is not sorted: 3\n{0} {1}: fields_4.txt:5: is not sorted: 11 g 5 gh\n{0} {1}: input is not in sorted order",
|
||||
"{0} {1}: fields_5.txt:4: is not sorted: 3\n{0} {1}: fields_4.txt:5: is not sorted: 11 g 5 gh\n{0} {1}: input is not in sorted order\n",
|
||||
ts.bin_path.to_string_lossy(),
|
||||
ts.util_name
|
||||
));
|
||||
|
@ -370,7 +370,7 @@ fn both_files_wrong_line_order() {
|
|||
.fails()
|
||||
.stdout_does_not_contain("5 e 3 ef")
|
||||
.stderr_is(&format!(
|
||||
"{0}: fields_5.txt:4: is not sorted: 3",
|
||||
"{0}: fields_5.txt:4: is not sorted: 3\n",
|
||||
ts.util_name
|
||||
));
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ fn non_unicode() {
|
|||
.arg("non-unicode_2.bin")
|
||||
.fails()
|
||||
.stderr_is(
|
||||
"join: unprintable field separators are only supported on unix-like platforms",
|
||||
"join: unprintable field separators are only supported on unix-like platforms\n",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue