1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

Fix some tests to not use CmdResult fields

This commit is contained in:
Gilad Naaman 2021-04-05 23:03:43 +03:00
parent 4695667c7c
commit 81d42aa2b3
22 changed files with 353 additions and 478 deletions

View file

@ -3,23 +3,19 @@ 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);
let result = new_ucmd!().run();
println!("env::var(CI).is_ok() = {}", env::var("CI").is_ok());
for (key, value) in env::vars() {
println!("{}: {}", key, value);
}
if (is_ci() || is_wsl()) && result.stderr.contains("error: no login name") {
if (is_ci() || is_wsl()) && result.stderr_str().contains("error: no login name") {
// ToDO: investigate WSL failure
// 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());
result.success();
assert!(!result.stdout_str().trim().is_empty());
}