aboutsummaryrefslogtreecommitdiff
path: root/tests/touch.test
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2019-03-26 15:40:00 -0500
committerRob Landley <rob@landley.net>2019-03-26 15:40:00 -0500
commitd78f05e91bb3a87a73b1d3fad29362447ee8e1f6 (patch)
tree89f486d2e5355f3cda46b8a94a77ffa9ab9da94d /tests/touch.test
parent0b7206b22e7ef9d5d72079caa943592e313a6d65 (diff)
downloadtoybox-d78f05e91bb3a87a73b1d3fad29362447ee8e1f6.tar.gz
Make touch use xparsedate() (result: -t and -d the same, autodetects format),
and fix tests to pass on host too.
Diffstat (limited to 'tests/touch.test')
-rw-r--r--tests/touch.test23
1 files changed, 11 insertions, 12 deletions
diff --git a/tests/touch.test b/tests/touch.test
index da6fe99a..b010f7d3 100644
--- a/tests/touch.test
+++ b/tests/touch.test
@@ -32,10 +32,10 @@ testing "-t seconds" \
"touch -t 201201231234.56 walrus && date -r walrus +%Y%m%d-%H%M%S.%N" \
"20120123-123456.000000000\n" "" ""
-testing "-t -" "touch -t 200109081946.40 - > walrus && date -r walrus +%s" \
- "1000000000\n" "" ""
+testing "-t -" "TZ=utc touch -t 200109090146.40 - > walrus && TZ=utc date -r walrus +%s" \
+ "1000000000\n" "" ""
-testing "-t nanoseconds" \
+SKIP_HOST=1 testing "-t nanoseconds" \
"touch -t 201201231234.56123456789 walrus && date -r walrus +%Y%m%d-%H%M%S.%N" \
"20120123-123456.123456789\n" "" ""
@@ -66,13 +66,12 @@ testing "-t CCMMDDhhmm" \
testing "-a" "touch -t 197101020304 walrus &&
touch -t 197203040506 -a walrus && stat -c '%X %Y' walrus" \
- "68562360 31662240\n" "" ""
-testing "-m" "touch -t 197101020304 walrus &&
- touch -t 197203040506 -m walrus && stat -c '%X %Y' walrus" \
- "31662240 68562360\n" "" ""
-testing "-am" "touch -t 197101020304 walrus &&
- touch -t 197203040506 -am walrus && stat -c '%X %Y' walrus" \
- "68562360 68562360\n" "" ""
-
-#testing "-t"
+ "68555160 31655040\n" "" ""
+testing "-m" "TZ=utc touch -t 197101020304 walrus &&
+ TZ=utc touch -t 197203040506 -m walrus && TZ=utc stat -c '%X %Y' walrus" \
+ "31633440 68533560\n" "" ""
+testing "-am" "TZ=utc touch -t 197101020304 walrus &&
+ TZ=utc touch -t 197203040506 -am walrus && TZ=utc stat -c '%X %Y' walrus" \
+ "68533560 68533560\n" "" ""
+
rm walrus walrus2