aboutsummaryrefslogtreecommitdiff
path: root/tests/date.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/date.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/date.test')
-rw-r--r--tests/date.test16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/date.test b/tests/date.test
index a317d35b..5c490b02 100644
--- a/tests/date.test
+++ b/tests/date.test
@@ -9,26 +9,26 @@
tz=Europe/Berlin
# Unix date parsing.
-testing "-d @0" "TZ=$tz date -d @0 2>&1" "Thu Jan 1 01:00:00 CET 1970\n" "" ""
+testing "-d @0" "TZ=$tz date -d @0" "Thu Jan 1 01:00:00 CET 1970\n" "" ""
testing "-d @0x123 invalid" "TZ=$tz date -d @0x123 2>/dev/null || echo expected error" "expected error\n" "" ""
# POSIX format with 2- and 4-digit years.
# All SKIP_HOST=1 because coreutils rejects POSIX format dates supplied to -d.
# These expected values are from running on the host without -d (not as root!).
SKIP_HOST=1 testing "-d MMDDhhmm" \
- "TZ=$tz date -d 06021234 2>&1" "Sun Jun 2 12:34:00 CEST $(date +%Y)\n" "" ""
+ "TZ=$tz date -d 06021234" "Sun Jun 2 12:34:00 CEST $(date +%Y)\n" "" ""
SKIP_HOST=1 testing "-d MMDDhhmmYY.SS" \
- "TZ=$tz date -d 1110143115.30 2>&1" "Tue Nov 10 14:31:30 CET 2015\n" "" ""
+ "TZ=$tz date -d 1110143115.30" "Tue Nov 10 14:31:30 CET 2015\n" "" ""
# busybox thinks this is the year 603 (ISO time 0602-12-34 19:82 with out of range fields normalized).
SKIP_HOST=1 testing "-d MMDDhhmmCCYY" \
- "TZ=$tz date -d 060212341982 2>&1" "Wed Jun 2 12:34:00 CEST 1982\n" "" ""
+ "TZ=$tz date -d 060212341982" "Wed Jun 2 12:34:00 CEST 1982\n" "" ""
SKIP_HOST=1 testing "-d MMDDhhmmCCYY.SS" \
- "TZ=$tz date -d 111014312015.30 2>&1" "Tue Nov 10 14:31:30 CET 2015\n" "" ""
+ "TZ=$tz date -d 111014312015.30" "Tue Nov 10 14:31:30 CET 2015\n" "" ""
# ISO date format.
-testing "-d 1980-01-02" "TZ=$tz date -d 1980-01-02 2>&1" "Wed Jan 2 00:00:00 CET 1980\n" "" ""
-testing "-d 1980-01-02 12:34" "TZ=$tz date -d '1980-01-02 12:34' 2>&1" "Wed Jan 2 12:34:00 CET 1980\n" "" ""
-testing "-d 1980-01-02 12:34:56" "TZ=$tz date -d '1980-01-02 12:34:56' 2>&1" "Wed Jan 2 12:34:56 CET 1980\n" "" ""
+testing "-d 1980-01-02" "TZ=$tz date -d 1980-01-02" "Wed Jan 2 00:00:00 CET 1980\n" "" ""
+testing "-d 1980-01-02 12:34" "TZ=$tz date -d '1980-01-02 12:34'" "Wed Jan 2 12:34:00 CET 1980\n" "" ""
+testing "-d 1980-01-02 12:34:56" "TZ=$tz date -d '1980-01-02 12:34:56'" "Wed Jan 2 12:34:56 CET 1980\n" "" ""
# Reject Unix times without a leading @.
testing "Unix time missing @" "TZ=$tz date 1438053157 2>/dev/null || echo no" \