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

Replace outdated time 0.1 dependancy with latest version of chrono (#2044)

* Replace outdated time 0.1 dependancy with latest version of chrono

I also noticed that times are being miscalculated on linux, so I fixed that.

* Add time test for issue #2042

* Cleanup use declarations

* Tie time test to `touch` feature
- if we compile with the right OS feature flag then we should have it,
  even on Windows
This commit is contained in:
paulotten 2021-04-07 02:41:04 -04:00 committed by GitHub
parent 272c5d8516
commit 52706372aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 10 deletions

View file

@ -172,3 +172,21 @@ fn test_du_h_flag_empty_file() {
assert_eq!(result.stderr, "");
assert_eq!(result.stdout, "0\tempty.txt\n");
}
#[cfg(feature = "touch")]
#[test]
fn test_du_time() {
let ts = TestScenario::new("du");
let touch = ts.ccmd("touch").arg("-a").arg("-m").arg("-t").arg("201505150000").arg("date_test").run();
assert!(touch.success);
let result = ts.ucmd().arg("--time").arg("date_test").run();
// cleanup by removing test file
ts.cmd("rm").arg("date_test").run();
assert!(result.success);
assert_eq!(result.stderr, "");
assert_eq!(result.stdout, "0\t2015-05-15 00:00\tdate_test\n");
}