mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
stat: add a test to verify time easily
This commit is contained in:
parent
e23dd68715
commit
326dc5080d
1 changed files with 19 additions and 0 deletions
|
@ -283,6 +283,25 @@ fn test_char() {
|
||||||
ts.ucmd().args(&args).succeeds().stdout_is(expected_stdout);
|
ts.ucmd().args(&args).succeeds().stdout_is(expected_stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "android", target_vendor = "apple"))]
|
||||||
|
#[test]
|
||||||
|
fn test_date() {
|
||||||
|
// Just test the date for the time 0.3 change
|
||||||
|
let args = [
|
||||||
|
"-c",
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||||
|
"%z",
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
"/dev/pts/ptmx",
|
||||||
|
#[cfg(any(target_vendor = "apple"))]
|
||||||
|
"%z",
|
||||||
|
#[cfg(any(target_os = "android", target_vendor = "apple"))]
|
||||||
|
"/dev/ptmx",
|
||||||
|
];
|
||||||
|
let ts = TestScenario::new(util_name!());
|
||||||
|
let expected_stdout = unwrap_or_return!(expected_result(&ts, &args)).stdout_move_str();
|
||||||
|
ts.ucmd().args(&args).succeeds().stdout_is(expected_stdout);
|
||||||
|
}
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
#[test]
|
#[test]
|
||||||
fn test_multi_files() {
|
fn test_multi_files() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue