git: 5a733026088f - main - touch: Test for -m flag
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 29 Jan 2026 15:52:21 UTC
The branch main has been updated by obiwac:
URL: https://cgit.FreeBSD.org/src/commit/?id=5a733026088f68a0171584045af968d1ea83804b
commit 5a733026088f68a0171584045af968d1ea83804b
Author: Aymeric Wibo <obiwac@FreeBSD.org>
AuthorDate: 2026-01-23 22:59:48 +0000
Commit: Aymeric Wibo <obiwac@FreeBSD.org>
CommitDate: 2026-01-29 15:51:17 +0000
touch: Test for -m flag
Reviewed by: kevans
Approved by: kevans
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D54853
---
usr.bin/touch/tests/touch_test.sh | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/usr.bin/touch/tests/touch_test.sh b/usr.bin/touch/tests/touch_test.sh
index cd9dc4623612..811d74983020 100644
--- a/usr.bin/touch/tests/touch_test.sh
+++ b/usr.bin/touch/tests/touch_test.sh
@@ -192,6 +192,19 @@ touch_just_atime_body()
atf_check_atime 84721020 file
}
+atf_test_case touch_just_mtime
+touch_just_mtime_head()
+{
+ atf_set descr "Update just modify time of file (-m)"
+}
+touch_just_mtime_body()
+{
+ atf_check touch -t 200406151337 file
+ atf_check touch -mt 197209071337 file
+ atf_check_mtime 84721020 file
+ atf_check_atime 1087306620 file
+}
+
atf_init_test_cases()
{
atf_add_test_case touch_none
@@ -204,5 +217,5 @@ atf_init_test_cases()
atf_add_test_case touch_symlink_h_flag
atf_add_test_case touch_symlink_no_h_flag
atf_add_test_case touch_just_atime
- # TODO: add test cases for -m
+ atf_add_test_case touch_just_mtime
}