mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
tests ~ fix CICD 'linux' test variations (whitespace variations)
This commit is contained in:
parent
bcc1cc0326
commit
6adddcf9e9
2 changed files with 32 additions and 6 deletions
|
@ -36,14 +36,32 @@ fn test_long_format() {
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
#[test]
|
#[test]
|
||||||
fn test_short_format() {
|
fn test_short_format_i() {
|
||||||
let scene = TestScenario::new(util_name!());
|
// allow whitespace variation
|
||||||
|
// * minor whitespace differences occur between platform built-in outputs; specifically, the number of trailing TABs may be variant
|
||||||
let args = ["-i"];
|
let args = ["-i"];
|
||||||
scene.ucmd().args(&args).run().stdout_is(expected_result(&args));
|
let actual = TestScenario::new(util_name!()).ucmd().args(&args).run().stdout;
|
||||||
|
let expect = expected_result(&args);
|
||||||
|
println!("actual: {:?}", actual);
|
||||||
|
println!("expect: {:?}", expect);
|
||||||
|
let v_actual: Vec<&str> = actual.split_whitespace().collect();
|
||||||
|
let v_expect: Vec<&str> = expect.split_whitespace().collect();
|
||||||
|
assert_eq!(v_actual, v_expect);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
#[test]
|
||||||
|
fn test_short_format_q() {
|
||||||
|
// allow whitespace variation
|
||||||
|
// * minor whitespace differences occur between platform built-in outputs; specifically, the number of trailing TABs may be variant
|
||||||
let args = ["-q"];
|
let args = ["-q"];
|
||||||
scene.ucmd().args(&args).run().stdout_is(expected_result(&args));
|
let actual = TestScenario::new(util_name!()).ucmd().args(&args).run().stdout;
|
||||||
|
let expect = expected_result(&args);
|
||||||
|
println!("actual: {:?}", actual);
|
||||||
|
println!("expect: {:?}", expect);
|
||||||
|
let v_actual: Vec<&str> = actual.split_whitespace().collect();
|
||||||
|
let v_expect: Vec<&str> = expect.split_whitespace().collect();
|
||||||
|
assert_eq!(v_actual, v_expect);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
|
|
|
@ -22,7 +22,15 @@ fn test_boot() {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_heading() {
|
fn test_heading() {
|
||||||
for opt in vec!["-H"] {
|
for opt in vec!["-H"] {
|
||||||
new_ucmd!().arg(opt).run().stdout_is(expected_result(opt));
|
// allow whitespace variation
|
||||||
|
// * minor whitespace differences occur between platform built-in outputs; specfically number of TABs between "TIME" and "COMMENT" may be variant
|
||||||
|
let actual = new_ucmd!().arg(opt).run().stdout;
|
||||||
|
let expect = expected_result(opt);
|
||||||
|
println!("actual: {:?}", actual);
|
||||||
|
println!("expect: {:?}", expect);
|
||||||
|
let v_actual: Vec<&str> = actual.split_whitespace().collect();
|
||||||
|
let v_expect: Vec<&str> = expect.split_whitespace().collect();
|
||||||
|
assert_eq!(v_actual, v_expect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue