mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #7274 from jfinkels/touch-obsolete-posix-args
touch: support obsolete POSIX timestamp argument
This commit is contained in:
commit
d86a7fb593
2 changed files with 108 additions and 20 deletions
|
@ -917,3 +917,27 @@ fn test_touch_reference_symlink_with_no_deref() {
|
|||
// Times should be taken from the symlink, not the destination
|
||||
assert_eq!((time, time), get_symlink_times(&at, arg));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_obsolete_posix_format() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.env("_POSIX2_VERSION", "199209")
|
||||
.env("POSIXLY_CORRECT", "1")
|
||||
.args(&["01010000", "11111111"])
|
||||
.succeeds()
|
||||
.no_output();
|
||||
assert!(at.file_exists("11111111"));
|
||||
assert!(!at.file_exists("01010000"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_obsolete_posix_format_with_year() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.env("_POSIX2_VERSION", "199209")
|
||||
.env("POSIXLY_CORRECT", "1")
|
||||
.args(&["0101000090", "11111111"])
|
||||
.succeeds()
|
||||
.no_output();
|
||||
assert!(at.file_exists("11111111"));
|
||||
assert!(!at.file_exists("0101000090"));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue