Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167683810
D54836.id170276.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D54836.id170276.diff
View Options
diff --git a/usr.bin/touch/tests/touch_test.sh b/usr.bin/touch/tests/touch_test.sh
--- a/usr.bin/touch/tests/touch_test.sh
+++ b/usr.bin/touch/tests/touch_test.sh
@@ -144,6 +144,35 @@
atf_check -s exit:1 test -f bar
}
+atf_test_case touch_symlink_h_flag
+touch_symlink_h_flag_head()
+{
+ atf_set descr "Update time of symlink but not file pointed to"
+}
+touch_symlink_h_flag_body()
+{
+ atf_check touch -t 200406151337 pointed
+ atf_check ln -s pointed symlink
+ atf_check touch -t 197209071337 -h symlink
+ atf_check_mtime 1087306620 pointed
+ atf_check_mtime 84721020 symlink
+}
+
+atf_test_case touch_symlink_no_h_flag
+touch_symlink_no_h_flag_head()
+{
+ atf_set descr "Update time of file pointed to but not symlink"
+}
+touch_symlink_no_h_flag_body()
+{
+ atf_check touch -t 200406151337 pointed
+ atf_check ln -s pointed symlink
+ local orig_mtime=$(stat -f %m symlink)
+ atf_check touch -t 197209071337 symlink
+ atf_check_mtime 84721020 pointed
+ atf_check_mtime $orig_mtime symlink
+}
+
atf_init_test_cases()
{
atf_add_test_case touch_none
@@ -153,5 +182,7 @@
atf_add_test_case touch_relative
atf_add_test_case touch_copy
atf_add_test_case touch_nocreate
- # TODO: add test cases for -a, -h, -m
+ atf_add_test_case touch_symlink_h_flag
+ atf_add_test_case touch_symlink_no_h_flag
+ # TODO: add test cases for -a, -m
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Aug 24, 6:26 PM (6 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37198899
Default Alt Text
D54836.id170276.diff (1 KB)
Attached To
Mode
D54836: touch: Tests for -h flag
Attached
Detach File
Event Timeline
Log In to Comment