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

tests/touch: fix tests

Fixes #782
This commit is contained in:
Michael Gehring 2016-01-02 09:54:19 +01:00
parent 4ebf29eb6a
commit b8ee9424c8

View file

@ -77,7 +77,7 @@ fn test_touch_set_mdhm_time() {
assert!(at.file_exists(file)); assert!(at.file_exists(file));
let start_of_year = str_to_filetime("%Y%m%d%H%M", "201501010000"); let start_of_year = str_to_filetime("%Y%m%d%H%M", &format!("{}01010000", 1900+time::now().tm_year));
let (atime, mtime) = get_file_times(&at, file); let (atime, mtime) = get_file_times(&at, file);
assert_eq!(atime, mtime); assert_eq!(atime, mtime);
assert_eq!(atime.seconds_relative_to_1970() - start_of_year.seconds_relative_to_1970(), assert_eq!(atime.seconds_relative_to_1970() - start_of_year.seconds_relative_to_1970(),
@ -97,7 +97,7 @@ fn test_touch_set_mdhms_time() {
assert!(at.file_exists(file)); assert!(at.file_exists(file));
let start_of_year = str_to_filetime("%Y%m%d%H%M.%S", "201501010000.00"); let start_of_year = str_to_filetime("%Y%m%d%H%M.%S", &format!("{}01010000.00", 1900+time::now().tm_year));
let (atime, mtime) = get_file_times(&at, file); let (atime, mtime) = get_file_times(&at, file);
assert_eq!(atime, mtime); assert_eq!(atime, mtime);
assert_eq!(atime.seconds_relative_to_1970() - start_of_year.seconds_relative_to_1970(), assert_eq!(atime.seconds_relative_to_1970() - start_of_year.seconds_relative_to_1970(),