From b5f44f3fa1fa8fa4b0e440ee2ed28889c898e47d Mon Sep 17 00:00:00 2001 From: Bluemangoo Date: Thu, 27 Mar 2025 12:55:02 +0000 Subject: [PATCH] vmstat: add simple tests --- tests/by-util/test_vmstat.rs | 16 ++++++++++++++++ tests/tests.rs | 4 ++++ 2 files changed, 20 insertions(+) create mode 100644 tests/by-util/test_vmstat.rs diff --git a/tests/by-util/test_vmstat.rs b/tests/by-util/test_vmstat.rs new file mode 100644 index 0000000..12d4ea7 --- /dev/null +++ b/tests/by-util/test_vmstat.rs @@ -0,0 +1,16 @@ +// 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_simple() { + new_ucmd!().succeeds(); +} + +#[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 62f7e81..620d49f 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -49,6 +49,10 @@ mod test_pidwait; #[path = "by-util/test_top.rs"] mod test_top; +#[cfg(feature = "vmstat")] +#[path = "by-util/test_vmstat.rs"] +mod test_vmstat; + #[cfg(feature = "snice")] #[path = "by-util/test_snice.rs"] mod test_snice;