mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 17:58:06 +00:00
test(uptime): Add a test (#1512)
This commit is contained in:
parent
601690b079
commit
2c90932ec0
2 changed files with 15 additions and 0 deletions
14
tests/test_uptime.rs
Normal file
14
tests/test_uptime.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
use common::util::*;
|
||||
|
||||
#[test]
|
||||
fn test_uptime() {
|
||||
let result = TestScenario::new(util_name!()).ucmd_keepenv().run();
|
||||
|
||||
println!("stdout = {}", result.stdout);
|
||||
println!("stderr = {}", result.stderr);
|
||||
|
||||
assert!(result.success);
|
||||
assert!(result.stdout.contains("load average:"));
|
||||
assert!(result.stdout.contains(" up "));
|
||||
// Don't check for users as it doesn't show in some CI
|
||||
}
|
|
@ -31,6 +31,7 @@ unix_only! {
|
|||
"stdbuf", test_stdbuf;
|
||||
"uname", test_uname;
|
||||
"unlink", test_unlink;
|
||||
"uptime", test_uptime;
|
||||
"users", test_users;
|
||||
"who", test_who;
|
||||
// Be aware of the trailing semicolon after the last item
|
||||
|
|
Loading…
Reference in a new issue