1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

touch: add -f flag (#8274)

* touch: fix f flag

* Update src/uu/touch/src/touch.rs

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>

* touch: add test for f flag

* Update src/uu/touch/src/touch.rs

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* Update tests/by-util/test_touch.rs

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* remove unnecessary comment

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
This commit is contained in:
VenetiaFurtado 2025-06-29 07:26:33 -06:00 committed by GitHub
parent 1d76a00840
commit c64adee068
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 0 deletions

View file

@ -1006,3 +1006,14 @@ fn test_obsolete_posix_format_with_year() {
assert!(at.file_exists("11111111"));
assert!(!at.file_exists("0101000090"));
}
#[test]
fn test_touch_f_option() {
let (at, mut ucmd) = at_and_ucmd!();
let file = "test_f_option.txt";
ucmd.args(&["-f", file]).succeeds().no_output();
assert!(at.file_exists(file));
at.remove(file);
}