mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
Merge pull request #7090 from sylvestre/env
env/stbuf: better handling of the errors
This commit is contained in:
commit
c531fb3973
4 changed files with 60 additions and 13 deletions
|
@ -80,6 +80,15 @@ fn test_env_version() {
|
|||
.stdout_contains(util_name!());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_env_permissions() {
|
||||
new_ucmd!()
|
||||
.arg(".")
|
||||
.fails()
|
||||
.code_is(126)
|
||||
.stderr_is("env: '.': Permission denied\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_echo() {
|
||||
#[cfg(target_os = "windows")]
|
||||
|
|
|
@ -10,6 +10,26 @@ fn invalid_input() {
|
|||
new_ucmd!().arg("-/").fails().code_is(125);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_permission() {
|
||||
new_ucmd!()
|
||||
.arg("-o1")
|
||||
.arg(".")
|
||||
.fails()
|
||||
.code_is(126)
|
||||
.stderr_contains("Permission denied");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_no_such() {
|
||||
new_ucmd!()
|
||||
.arg("-o1")
|
||||
.arg("no_such")
|
||||
.fails()
|
||||
.code_is(127)
|
||||
.stderr_contains("No such file or directory");
|
||||
}
|
||||
|
||||
#[cfg(all(not(target_os = "windows"), not(target_os = "openbsd")))]
|
||||
#[test]
|
||||
fn test_stdbuf_unbuffered_stdout() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue