mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
parent
88d0bb01c0
commit
3714e2201b
3 changed files with 100 additions and 50 deletions
|
@ -1 +1,57 @@
|
|||
// ToDO: add tests
|
||||
use crate::common::util::*;
|
||||
|
||||
#[test]
|
||||
#[cfg(not(windows))]
|
||||
fn test_dev_null() {
|
||||
new_ucmd!()
|
||||
.pipe_in("</dev/null")
|
||||
.fails()
|
||||
.stdout_is("not a tty\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(windows))]
|
||||
fn test_dev_null_silent() {
|
||||
new_ucmd!()
|
||||
.args(&["-s"])
|
||||
.pipe_in("</dev/null")
|
||||
.fails()
|
||||
.stdout_is("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_close_stdin() {
|
||||
new_ucmd!().pipe_in("<&-").fails().stdout_is("not a tty\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_close_stdin_silent() {
|
||||
new_ucmd!()
|
||||
.args(&["-s"])
|
||||
.pipe_in("<&-")
|
||||
.fails()
|
||||
.stdout_is("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_close_stdin_silent_long() {
|
||||
new_ucmd!()
|
||||
.args(&["--silent"])
|
||||
.pipe_in("<&-")
|
||||
.fails()
|
||||
.stdout_is("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_close_stdin_silent_alias() {
|
||||
new_ucmd!()
|
||||
.args(&["--quiet"])
|
||||
.pipe_in("<&-")
|
||||
.fails()
|
||||
.stdout_is("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_wrong_argument() {
|
||||
new_ucmd!().args(&["a"]).fails();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue