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:
parent
417d238bba
commit
d1aa1ac963
5 changed files with 47 additions and 44 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue