1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-16 03:36:18 +00:00

touch: improve the -d option support of other dates

This commit is contained in:
Sylvestre Ledru 2022-05-05 22:48:37 +02:00
parent 65d0f5ba9f
commit 06ef89b3d8
2 changed files with 25 additions and 10 deletions

View file

@ -438,7 +438,7 @@ fn test_touch_set_date4() {
assert!(at.file_exists(file));
let expected = FileTime::from_unix_time(60213, 0);
let expected = FileTime::from_unix_time(67413, 0);
let (atime, mtime) = get_file_times(&at, file);
assert_eq!(atime, mtime);
assert_eq!(atime, expected);
@ -456,7 +456,13 @@ fn test_touch_set_date5() {
assert!(at.file_exists(file));
let expected = FileTime::from_unix_time(60213, 023456789);
// Slightly different result on Windows for nano seconds
// TODO: investigate
#[cfg(windows)]
let expected = FileTime::from_unix_time(67413, 23456700);
#[cfg(not(windows))]
let expected = FileTime::from_unix_time(67413, 23456789);
let (atime, mtime) = get_file_times(&at, file);
assert_eq!(atime, mtime);
assert_eq!(atime, expected);