mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 17:58:06 +00:00
wc: Adjust expected error messages for Windows
This commit is contained in:
parent
0f1e79fe29
commit
4943517327
1 changed files with 11 additions and 6 deletions
|
@ -205,22 +205,27 @@ fn test_file_bytes_dictate_width() {
|
|||
/// Test that getting counts from a directory is an error.
|
||||
#[test]
|
||||
fn test_read_from_directory_error() {
|
||||
// TODO To match GNU `wc`, the `stdout` should be:
|
||||
//
|
||||
// " 0 0 0 .\n"
|
||||
//
|
||||
#[cfg(not(windows))]
|
||||
const MSG: &str = ".: Is a directory";
|
||||
#[cfg(windows)]
|
||||
const MSG: &str = ".: Access is denied";
|
||||
new_ucmd!()
|
||||
.args(&["."])
|
||||
.fails()
|
||||
.stderr_contains(".: Is a directory")
|
||||
.stderr_contains(MSG)
|
||||
.stdout_is(" 0 0 0 .\n");
|
||||
}
|
||||
|
||||
/// Test that getting counts from nonexistent file is an error.
|
||||
#[test]
|
||||
fn test_read_from_nonexistent_file() {
|
||||
#[cfg(not(windows))]
|
||||
const MSG: &str = "bogusfile: No such file or directory";
|
||||
#[cfg(windows)]
|
||||
const MSG: &str = "bogusfile: The system cannot find the file specified";
|
||||
new_ucmd!()
|
||||
.args(&["bogusfile"])
|
||||
.fails()
|
||||
.stderr_contains("bogusfile: No such file or directory");
|
||||
.stderr_contains(MSG)
|
||||
.stdout_is("");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue