summaryrefslogtreecommitdiff
path: root/tests/date
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-07-13 16:36:10 +0000
committerJim Meyering <jim@meyering.net>1997-07-13 16:36:10 +0000
commit8568fe543ba5631ec9afb31b7ceab77b84ce364f (patch)
treedd9b9331ad2738d1226cfbd95b351888afe5a6a8 /tests/date
parent1c9c4d7230fe1ef02a4ebfc205b1639891e6dd19 (diff)
downloadcoreutils-8568fe543ba5631ec9afb31b7ceab77b84ce364f.tar.xz
.
Diffstat (limited to 'tests/date')
-rw-r--r--tests/date/Makefile.am9
-rw-r--r--tests/date/Makefile.in9
-rwxr-xr-xtests/date/date-tests63
3 files changed, 67 insertions, 14 deletions
diff --git a/tests/date/Makefile.am b/tests/date/Makefile.am
index d4f6f08ed..ca1d100ba 100644
--- a/tests/date/Makefile.am
+++ b/tests/date/Makefile.am
@@ -7,8 +7,8 @@ maint_gen = 1.X 2.X 3.X 4.X 5.X 6.X 7.X 8.X 9.X leap-1.X U95-1.X U95-2.X \
U95-3.X U92-1.X U92-2.X U92-3.X V92-1.X V92-2.X V92-3.X W92-1.X W92-2.X \
W92-3.X millen-1.X rel-0.X rel-1a.X rel-1b.X rel-2a.X rel-2b.X rel-2c.X \
rel-2d.X rel-2e.X rel-2f.X rel-2g.X rel-3a.X next-s.X next-m.X next-h.X \
-next-d.X next-w.X next-mo.X next-y.X utc-0.X utc-1.I utc-1.X date2sec-0.X \
-date2sec-1.X sec2date-0.X
+next-d.X next-w.X next-mo.X next-y.X utc-0.X utc-0a.X utc-1.I utc-1.X \
+utc-1a.I utc-1a.X date2sec-0.X date2sec-0a.X date2sec-1.X sec2date-0.X
run_gen = 1.O 1.E 2.O 2.E 3.O 3.E 4.O 4.E 5.O 5.E 6.O 6.E 7.O 7.E 8.O 8.E 9.O \
9.E leap-1.O leap-1.E U95-1.O U95-1.E U95-2.O U95-2.E U95-3.O U95-3.E U92-1.O \
U92-1.E U92-2.O U92-2.E U92-3.O U92-3.E V92-1.O V92-1.E V92-2.O V92-2.E \
@@ -17,8 +17,9 @@ millen-1.E rel-0.O rel-0.E rel-1a.O rel-1a.E rel-1b.O rel-1b.E rel-2a.O \
rel-2a.E rel-2b.O rel-2b.E rel-2c.O rel-2c.E rel-2d.O rel-2d.E rel-2e.O \
rel-2e.E rel-2f.O rel-2f.E rel-2g.O rel-2g.E rel-3a.O rel-3a.E next-s.O \
next-s.E next-m.O next-m.E next-h.O next-h.E next-d.O next-d.E next-w.O \
-next-w.E next-mo.O next-mo.E next-y.O next-y.E utc-0.O utc-0.E utc-1.O \
-utc-1.E date2sec-0.O date2sec-0.E date2sec-1.O date2sec-1.E sec2date-0.O \
+next-w.E next-mo.O next-mo.E next-y.O next-y.E utc-0.O utc-0.E utc-0a.O \
+utc-0a.E utc-1.O utc-1.E utc-1a.O utc-1a.E date2sec-0.O date2sec-0.E \
+date2sec-0a.O date2sec-0a.E date2sec-1.O date2sec-1.E sec2date-0.O \
sec2date-0.E
##test-files-end
diff --git a/tests/date/Makefile.in b/tests/date/Makefile.in
index eed0e40a4..249251820 100644
--- a/tests/date/Makefile.in
+++ b/tests/date/Makefile.in
@@ -96,8 +96,8 @@ maint_gen = 1.X 2.X 3.X 4.X 5.X 6.X 7.X 8.X 9.X leap-1.X U95-1.X U95-2.X \
U95-3.X U92-1.X U92-2.X U92-3.X V92-1.X V92-2.X V92-3.X W92-1.X W92-2.X \
W92-3.X millen-1.X rel-0.X rel-1a.X rel-1b.X rel-2a.X rel-2b.X rel-2c.X \
rel-2d.X rel-2e.X rel-2f.X rel-2g.X rel-3a.X next-s.X next-m.X next-h.X \
-next-d.X next-w.X next-mo.X next-y.X utc-0.X utc-1.I utc-1.X date2sec-0.X \
-date2sec-1.X sec2date-0.X
+next-d.X next-w.X next-mo.X next-y.X utc-0.X utc-0a.X utc-1.I utc-1.X \
+utc-1a.I utc-1a.X date2sec-0.X date2sec-0a.X date2sec-1.X sec2date-0.X
run_gen = 1.O 1.E 2.O 2.E 3.O 3.E 4.O 4.E 5.O 5.E 6.O 6.E 7.O 7.E 8.O 8.E 9.O \
9.E leap-1.O leap-1.E U95-1.O U95-1.E U95-2.O U95-2.E U95-3.O U95-3.E U92-1.O \
U92-1.E U92-2.O U92-2.E U92-3.O U92-3.E V92-1.O V92-1.E V92-2.O V92-2.E \
@@ -106,8 +106,9 @@ millen-1.E rel-0.O rel-0.E rel-1a.O rel-1a.E rel-1b.O rel-1b.E rel-2a.O \
rel-2a.E rel-2b.O rel-2b.E rel-2c.O rel-2c.E rel-2d.O rel-2d.E rel-2e.O \
rel-2e.E rel-2f.O rel-2f.E rel-2g.O rel-2g.E rel-3a.O rel-3a.E next-s.O \
next-s.E next-m.O next-m.E next-h.O next-h.E next-d.O next-d.E next-w.O \
-next-w.E next-mo.O next-mo.E next-y.O next-y.E utc-0.O utc-0.E utc-1.O \
-utc-1.E date2sec-0.O date2sec-0.E date2sec-1.O date2sec-1.E sec2date-0.O \
+next-w.E next-mo.O next-mo.E next-y.O next-y.E utc-0.O utc-0.E utc-0a.O \
+utc-0a.E utc-1.O utc-1.E utc-1a.O utc-1a.E date2sec-0.O date2sec-0.E \
+date2sec-0a.O date2sec-0a.E date2sec-1.O date2sec-1.E sec2date-0.O \
sec2date-0.E
EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen)
diff --git a/tests/date/date-tests b/tests/date/date-tests
index 2b669d45a..808e52bfc 100755
--- a/tests/date/date-tests
+++ b/tests/date/date-tests
@@ -715,23 +715,40 @@ 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
+TZ=UTC+4 $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
+ $echo "Test utc-0(TZ=UTC+4) 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;
+ 0) if test "$VERBOSE" ; then $echo "passed utc-0(TZ=UTC+4)"; fi ;;
+ 1) $echo "Test utc-0(TZ=UTC+4) 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;
+ 2) $echo "Test utc-0(TZ=UTC+4) 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
+LANG=C TZ=UTC $xx -u -d '08/01/97 6:00 UTC +4 hours' '+%D,%H:%M' > utc-0a.O 2> utc-0a.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test utc-0a(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp utc-0a.O $srcdir/utc-0a.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed utc-0a(LANG=C TZ=UTC)"; fi ;;
+ 1) $echo "Test utc-0a(LANG=C TZ=UTC) failed: files utc-0a.O and $srcdir/utc-0a.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test utc-0a(LANG=C TZ=UTC) may have failed." 1>&2;
+ $echo The command "cmp utc-0a.O $srcdir/utc-0a.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s utc-0a.E || rm -f utc-0a.E
TZ=UTC+1 $xx -u --file=- '+%Y-%m-%d %T' < $srcdir/utc-1.I > utc-1.O 2> utc-1.E
code=$?
if test $code != 0 ; then
@@ -749,6 +766,23 @@ else
esac
fi
test -s utc-1.E || rm -f utc-1.E
+LANG=C TZ=UTC $xx -u --file=- '+%Y-%m-%d %T' < $srcdir/utc-1a.I > utc-1a.O 2> utc-1a.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test utc-1a(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp utc-1a.O $srcdir/utc-1a.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed utc-1a(LANG=C TZ=UTC)"; fi ;;
+ 1) $echo "Test utc-1a(LANG=C TZ=UTC) failed: files utc-1a.O and $srcdir/utc-1a.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test utc-1a(LANG=C TZ=UTC) may have failed." 1>&2;
+ $echo The command "cmp utc-1a.O $srcdir/utc-1a.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s utc-1a.E || rm -f utc-1a.E
TZ=UTC+2 $xx -d '1970-01-01 00:00:01' +%s > date2sec-0.O 2> date2sec-0.E
code=$?
if test $code != 0 ; then
@@ -766,6 +800,23 @@ else
esac
fi
test -s date2sec-0.E || rm -f date2sec-0.E
+LANG=C TZ=UTC $xx -d '1970-01-01 00:00:01 UTC +2 hours' +%s > date2sec-0a.O 2> date2sec-0a.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test date2sec-0a(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp date2sec-0a.O $srcdir/date2sec-0a.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed date2sec-0a(LANG=C TZ=UTC)"; fi ;;
+ 1) $echo "Test date2sec-0a(LANG=C TZ=UTC) failed: files date2sec-0a.O and $srcdir/date2sec-0a.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test date2sec-0a(LANG=C TZ=UTC) may have failed." 1>&2;
+ $echo The command "cmp date2sec-0a.O $srcdir/date2sec-0a.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s date2sec-0a.E || rm -f date2sec-0a.E
LANG=C TZ=UTC $xx -d 2000-01-01 +%s > date2sec-1.O 2> date2sec-1.E
code=$?
if test $code != 0 ; then
@@ -801,7 +852,7 @@ else
fi
test -s sec2date-0.E || rm -f sec2date-0.E
if test $errors = 0 ; then
- $echo Passed all 46 tests. 1>&2
+ $echo Passed all 49 tests. 1>&2
else
$echo Failed $errors tests. 1>&2
fi