aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAymeric Wibo <obiwac@FreeBSD.org>2026-01-23 22:59:48 +0000
committerAymeric Wibo <obiwac@FreeBSD.org>2026-01-29 15:51:17 +0000
commit5a733026088f68a0171584045af968d1ea83804b (patch)
tree72526fd237b2097ac369c50a2c08f5984aa213b4
parent578b4ec8f1a4134027e66a156e6cf801284aab14 (diff)
touch: Test for -m flag
Reviewed by: kevans Approved by: kevans Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D54853
-rw-r--r--usr.bin/touch/tests/touch_test.sh15
1 files changed, 14 insertions, 1 deletions
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
}