From 9f3d8aa80fa4d7216106610b077b6d6e4e6dbed4 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 18 Oct 2016 04:10:01 -0500 Subject: 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). --- tests/touch.test | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/touch.test') 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" -- cgit v1.2.3