Files
uutil-linux/tests/by-util/test_mesg.rs
Tuomas Tynkkynen c8aa5a6b57 mesg: Add tool
2025-03-09 02:13:47 +02:00

37 lines
897 B
Rust

// 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");
}
}