From 40199f249faea961da6ec7774bda476fa31685dd Mon Sep 17 00:00:00 2001 From: Krysztal Huang Date: Mon, 8 Jul 2024 16:35:44 +0800 Subject: [PATCH] pidof: Add test file --- tests/by-util/test_pidof.rs | 11 +++++++++++ tests/tests.rs | 4 ++++ 2 files changed, 15 insertions(+) create mode 100644 tests/by-util/test_pidof.rs diff --git a/tests/by-util/test_pidof.rs b/tests/by-util/test_pidof.rs new file mode 100644 index 0000000..85ca6f4 --- /dev/null +++ b/tests/by-util/test_pidof.rs @@ -0,0 +1,11 @@ +// This file is part of the uutils procps 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_arg() { + new_ucmd!().arg("--definitely-invalid").fails().code_is(1); +} diff --git a/tests/tests.rs b/tests/tests.rs index 3a5e8ce..9dd4e1e 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -32,3 +32,7 @@ mod test_slabtop; #[cfg(feature = "pgrep")] #[path = "by-util/test_pgrep.rs"] mod test_pgrep; + +#[cfg(feature = "pidof")] +#[path = "by-util/test_pidof.rs"] +mod test_pidof;