mesg: Add tool
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
// This file is part of the uutils util-linux package.
|
||||
//
|
||||
// For the full copyright and license information, please view the LICENSE
|
||||
// file that was distributed with this source code.
|
||||
|
||||
use crate::common::util::TestScenario;
|
||||
|
||||
#[test]
|
||||
fn test_invalid_verb() {
|
||||
new_ucmd!().arg("foo").fails().code_is(1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(target_family = "unix")]
|
||||
fn test_no_terminal() {
|
||||
for args in &[vec![], vec!["y"], vec!["n"]] {
|
||||
new_ucmd!()
|
||||
.args(args)
|
||||
.fails()
|
||||
.code_is(2)
|
||||
.stderr_contains("stdin/stdout/stderr is not a terminal");
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_family = "unix"))]
|
||||
mod non_unix {
|
||||
use crate::common::util::TestScenario;
|
||||
|
||||
#[test]
|
||||
fn test_fails_on_unsupported_platforms() {
|
||||
new_ucmd!()
|
||||
.fails()
|
||||
.code_is(1)
|
||||
.stderr_is("mesg: `mesg` is available only on Unix platforms.\n");
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,10 @@ mod test_lsmem;
|
||||
#[path = "by-util/test_lslocks.rs"]
|
||||
mod test_lslocks;
|
||||
|
||||
#[cfg(feature = "mesg")]
|
||||
#[path = "by-util/test_mesg.rs"]
|
||||
mod test_mesg;
|
||||
|
||||
#[cfg(feature = "mountpoint")]
|
||||
#[path = "by-util/test_mountpoint.rs"]
|
||||
mod test_mountpoint;
|
||||
|
||||
Reference in New Issue
Block a user