1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 13:37:48 +00:00

workaround the tests/touch/60-seconds test to skip leap second

This commit is contained in:
Sylvestre Ledru 2022-04-28 00:06:07 +02:00
parent 3b3585bbe5
commit c009e1bed8

View file

@ -337,7 +337,12 @@ fn parse_timestamp(s: &str) -> UResult<FileTime> {
format = YYYYMMDDHHMM_DOT_SS_FORMAT;
ts = "20".to_owned() + &ts;
}
if (format == YYYYMMDDHHMM_DOT_SS_FORMAT || format == YYMMDDHHMM_DOT_SS_FORMAT)
&& ts.ends_with(".60")
{
// Work around to disable leap seconds
ts = ts.replace(".60", ".59");
}
let tm = time::PrimitiveDateTime::parse(&ts, &format)
.map_err(|_| USimpleError::new(1, format!("invalid date ts format {}", ts.quote())))?;