mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
test(logname) add a test for logname
This commit is contained in:
parent
a7de28a714
commit
332dc5d2f2
1 changed files with 27 additions and 1 deletions
|
@ -1 +1,27 @@
|
|||
// ToDO: add tests
|
||||
use crate::common::util::*;
|
||||
use std::env;
|
||||
|
||||
#[test]
|
||||
fn test_normal() {
|
||||
let (_, mut ucmd) = at_and_ucmd!();
|
||||
|
||||
let result = ucmd.run();
|
||||
println!("result.stdout = {}", result.stdout);
|
||||
println!("result.stderr = {}", result.stderr);
|
||||
println!("env::var(CI).is_ok() = {}", env::var("CI").is_ok());
|
||||
|
||||
for (key, value) in env::vars() {
|
||||
println!("{}: {}", key, value);
|
||||
}
|
||||
if env::var("USER").is_ok()
|
||||
&& env::var("USER").unwrap() == "runner"
|
||||
&& result.stderr.contains("error: no login name")
|
||||
{
|
||||
// In the CI, some server are failing to return logname.
|
||||
// As seems to be a configuration issue, ignoring it
|
||||
return;
|
||||
}
|
||||
|
||||
assert!(result.success);
|
||||
assert!(!result.stdout.trim().is_empty());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue