diff options
author | Jim Meyering <jim@meyering.net> | 1997-07-12 21:57:51 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1997-07-12 21:57:51 +0000 |
commit | 626e48dcca275670a19a104fd4009c1b62779d9a (patch) | |
tree | d454eb30a94c6f1009b0e9bee4049d62e6b25004 /tests/date | |
parent | f1994a3f6e3f874ed0fad4faf3843671378244e0 (diff) | |
download | coreutils-626e48dcca275670a19a104fd4009c1b62779d9a.tar.xz |
.
Diffstat (limited to 'tests/date')
-rwxr-xr-x | tests/date/date-tests | 70 |
1 files changed, 69 insertions, 1 deletions
diff --git a/tests/date/date-tests b/tests/date/date-tests index 1878d984b..eb1e8d7a8 100755 --- a/tests/date/date-tests +++ b/tests/date/date-tests @@ -715,8 +715,76 @@ else esac fi test -s next-y.E || rm -f next-y.E +TZ=EST5EDT $xx -u -d '08/01/97 6:00' '+%D,%H:%M' > utc-0.O 2> utc-0.E +code=$? +if test $code != 0 ; then + $echo "Test utc-0(TZ=EST5EDT) failed: ../../src/date return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp utc-0.O $srcdir/utc-0.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed utc-0(TZ=EST5EDT)"; fi ;; + 1) $echo "Test utc-0(TZ=EST5EDT) failed: files utc-0.O and $srcdir/utc-0.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test utc-0(TZ=EST5EDT) may have failed." 1>&2; + $echo The command "cmp utc-0.O $srcdir/utc-0.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s utc-0.E || rm -f utc-0.E +TZ=UTC+2 $xx -d '1970-01-01 00:00:01' +%s > utc-1.O 2> utc-1.E +code=$? +if test $code != 0 ; then + $echo "Test utc-1(TZ=UTC+2) failed: ../../src/date return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp utc-1.O $srcdir/utc-1.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed utc-1(TZ=UTC+2)"; fi ;; + 1) $echo "Test utc-1(TZ=UTC+2) failed: files utc-1.O and $srcdir/utc-1.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test utc-1(TZ=UTC+2) may have failed." 1>&2; + $echo The command "cmp utc-1.O $srcdir/utc-1.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s utc-1.E || rm -f utc-1.E +LANG=C TZ=UTC $xx -d 2000-01-01 +%s > date2sec-0.O 2> date2sec-0.E +code=$? +if test $code != 0 ; then + $echo "Test date2sec-0(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp date2sec-0.O $srcdir/date2sec-0.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed date2sec-0(LANG=C TZ=UTC)"; fi ;; + 1) $echo "Test date2sec-0(LANG=C TZ=UTC) failed: files date2sec-0.O and $srcdir/date2sec-0.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test date2sec-0(LANG=C TZ=UTC) may have failed." 1>&2; + $echo The command "cmp date2sec-0.O $srcdir/date2sec-0.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s date2sec-0.E || rm -f date2sec-0.E +LANG=C TZ=UTC $xx -d '1970-01-01 UTC 946684800 sec' +'%Y-%m-%d %T %z' > sec2date-0.O 2> sec2date-0.E +code=$? +if test $code != 0 ; then + $echo "Test sec2date-0(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2 + errors=`expr $errors + 1` +else + cmp sec2date-0.O $srcdir/sec2date-0.X > /dev/null 2>&1 + case $? in + 0) if test "$VERBOSE" ; then $echo "passed sec2date-0(LANG=C TZ=UTC)"; fi ;; + 1) $echo "Test sec2date-0(LANG=C TZ=UTC) failed: files sec2date-0.O and $srcdir/sec2date-0.X differ" 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo "Test sec2date-0(LANG=C TZ=UTC) may have failed." 1>&2; + $echo The command "cmp sec2date-0.O $srcdir/sec2date-0.X" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s sec2date-0.E || rm -f sec2date-0.E if test $errors = 0 ; then - $echo Passed all 41 tests. 1>&2 + $echo Passed all 45 tests. 1>&2 else $echo Failed $errors tests. 1>&2 fi |