aboutsummaryrefslogtreecommitdiff
path: root/tests/touch.test
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-10-18 04:10:01 -0500
committerRob Landley <rob@landley.net>2016-10-18 04:10:01 -0500
commit9f3d8aa80fa4d7216106610b077b6d6e4e6dbed4 (patch)
treeb0694d1c750be7340583dcd39dbc0dd4ecf82238 /tests/touch.test
parent64cbbab181749f85f3bcdb8576c5d530c453db84 (diff)
downloadtoybox-9f3d8aa80fa4d7216106610b077b6d6e4e6dbed4.tar.gz
Unify touch -t and -d handling, allow posix's underspecified "time designator"
T to be a space instead (because the posix says so, no idea why), initialize default values reliably including zeroing daylight savings time field (which is handled inconsistently by libc and just screws stuff up).
Diffstat (limited to 'tests/touch.test')
-rwxr-xr-xtests/touch.test5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/touch.test b/tests/touch.test
index d193d7cc..d5bef815 100755
--- a/tests/touch.test
+++ b/tests/touch.test
@@ -35,6 +35,11 @@ testing "-r" \
"touch -r walrus walrus2 && date -r walrus2 +%s.%N" \
"1234567890.123456789\n" "" ""
+# Yes, the year could roll over while you're running this test. I do not care.
+testing "-t MMDDhhmm" \
+ "touch -t 01231234 input && date +%Y-%m-%d:%H-%M-%S -r input" \
+ "$(date +%Y)-01-23:12-34-00\n" "" ""
+
#testing "-a"
#testing "-m"
#testing "-am"