mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
Merge pull request #7755 from lavafroth/date-test-abs-diff
refactor(tests): use absolute difference of dates to check if they are within a window
This commit is contained in:
parent
c35d26dc51
commit
131ee87781
1 changed files with 1 additions and 2 deletions
|
@ -435,8 +435,7 @@ fn test_negative_offset() {
|
||||||
|
|
||||||
// Is the resulting date roughly what is expected?
|
// Is the resulting date roughly what is expected?
|
||||||
let expected_date = Utc::now() - offset;
|
let expected_date = Utc::now() - offset;
|
||||||
date > expected_date - Duration::minutes(10)
|
(date.to_utc() - expected_date).abs() < Duration::minutes(10)
|
||||||
&& date < expected_date + Duration::minutes(10)
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue