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

Use the humantime_to_duration crate

This commit is contained in:
Sylvestre Ledru 2023-04-23 23:15:32 +02:00
parent 417d238bba
commit d1aa1ac963
5 changed files with 47 additions and 44 deletions

View file

@ -608,7 +608,15 @@ fn test_touch_set_date_relative_smoke() {
// > (equivalent to day), the string yesterday is worth one day
// > in the past (equivalent to day ago).
//
let times = ["yesterday", "tomorrow", "now"];
let times = [
"yesterday",
"tomorrow",
"now",
"2 seconds",
"2 years 1 week",
"2 days ago",
"2 months and 1 second",
];
for time in times {
let (at, mut ucmd) = at_and_ucmd!();
at.touch("f");
@ -617,6 +625,11 @@ fn test_touch_set_date_relative_smoke() {
.no_stderr()
.no_stdout();
}
let (at, mut ucmd) = at_and_ucmd!();
at.touch("f");
ucmd.args(&["-d", "a", "f"])
.fails()
.stderr_contains("touch: Unable to parse date");
}
#[test]