lslocks
: Add test skeleton
This commit is contained in:
parent
ee14c44540
commit
7e0fde94dd
tests
22
tests/by-util/test_lslocks.rs
Normal file
22
tests/by-util/test_lslocks.rs
Normal file
@ -0,0 +1,22 @@
|
||||
// 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]
|
||||
#[cfg(target_os = "linux")]
|
||||
fn test_column_headers() {
|
||||
let res = new_ucmd!().succeeds();
|
||||
let stdout = res.no_stderr().stdout_str();
|
||||
|
||||
let header_line = stdout.lines().next().unwrap();
|
||||
let cols: Vec<_> = header_line.split_whitespace().collect();
|
||||
|
||||
assert_eq!(cols.len(), 7);
|
||||
assert_eq!(
|
||||
cols,
|
||||
vec!["COMMAND", "PID", "TYPE", "MODE", "M", "START", "END"]
|
||||
);
|
||||
}
|
@ -13,6 +13,10 @@ mod test_lscpu;
|
||||
#[path = "by-util/test_lsmem.rs"]
|
||||
mod test_lsmem;
|
||||
|
||||
#[cfg(feature = "lslocks")]
|
||||
#[path = "by-util/test_lslocks.rs"]
|
||||
mod test_lslocks;
|
||||
|
||||
#[cfg(feature = "mountpoint")]
|
||||
#[path = "by-util/test_mountpoint.rs"]
|
||||
mod test_mountpoint;
|
||||
|
Loading…
x
Reference in New Issue
Block a user