mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +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;
|
"stdbuf", test_stdbuf;
|
||||||
"uname", test_uname;
|
"uname", test_uname;
|
||||||
"unlink", test_unlink;
|
"unlink", test_unlink;
|
||||||
|
"uptime", test_uptime;
|
||||||
"users", test_users;
|
"users", test_users;
|
||||||
"who", test_who;
|
"who", test_who;
|
||||||
// Be aware of the trailing semicolon after the last item
|
// Be aware of the trailing semicolon after the last item
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue