summaryrefslogtreecommitdiff
path: root/tests/date
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-08-30 14:59:37 +0000
committerJim Meyering <jim@meyering.net>1999-08-30 14:59:37 +0000
commit794af090073aa79990868eab0dbe7eaacc337ac1 (patch)
tree138b7b60bf0e8ffe38695f53dbf65b95c21ac594 /tests/date
parent128307fa88455d6fba6fc95e29ddd4178b327911 (diff)
downloadcoreutils-794af090073aa79990868eab0dbe7eaacc337ac1.tar.xz
.
Diffstat (limited to 'tests/date')
-rw-r--r--tests/date/Makefile.am6
-rwxr-xr-xtests/date/date-tests104
2 files changed, 107 insertions, 3 deletions
diff --git a/tests/date/Makefile.am b/tests/date/Makefile.am
index 37c6ed274..764a56692 100644
--- a/tests/date/Makefile.am
+++ b/tests/date/Makefile.am
@@ -8,7 +8,8 @@ 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-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
+utc-1a.I utc-1a.X date2sec-0.X date2sec-0a.X date2sec-1.X sec2date-0.X \
+this-m.X this-h.X this-w.X this-mo.X this-y.X risks-1.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 \
@@ -20,7 +21,8 @@ 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-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
+sec2date-0.E this-m.O this-m.E this-h.O this-h.E this-w.O this-w.E this-mo.O \
+this-mo.E this-y.O this-y.E risks-1.O risks-1.E
##test-files-end
EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
diff --git a/tests/date/date-tests b/tests/date/date-tests
index 0badcf79b..edd05d6a6 100755
--- a/tests/date/date-tests
+++ b/tests/date/date-tests
@@ -851,8 +851,110 @@ else
esac
fi
test -s sec2date-0.E || rm -f sec2date-0.E
+LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 this minute' '+%Y-%m-%d %T' > this-m.O 2> this-m.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test this-m(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp this-m.O $srcdir/this-m.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed this-m(LANG=C TZ=UTC)"; fi ;;
+ 1) $echo "Test this-m(LANG=C TZ=UTC) failed: files this-m.O and $srcdir/this-m.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test this-m(LANG=C TZ=UTC) may have failed." 1>&2;
+ $echo The command "cmp this-m.O $srcdir/this-m.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s this-m.E || rm -f this-m.E
+LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 this hour' '+%Y-%m-%d %T' > this-h.O 2> this-h.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test this-h(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp this-h.O $srcdir/this-h.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed this-h(LANG=C TZ=UTC)"; fi ;;
+ 1) $echo "Test this-h(LANG=C TZ=UTC) failed: files this-h.O and $srcdir/this-h.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test this-h(LANG=C TZ=UTC) may have failed." 1>&2;
+ $echo The command "cmp this-h.O $srcdir/this-h.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s this-h.E || rm -f this-h.E
+LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 this week' '+%Y-%m-%d %T' > this-w.O 2> this-w.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test this-w(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp this-w.O $srcdir/this-w.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed this-w(LANG=C TZ=UTC)"; fi ;;
+ 1) $echo "Test this-w(LANG=C TZ=UTC) failed: files this-w.O and $srcdir/this-w.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test this-w(LANG=C TZ=UTC) may have failed." 1>&2;
+ $echo The command "cmp this-w.O $srcdir/this-w.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s this-w.E || rm -f this-w.E
+LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 this month' '+%Y-%m-%d %T' > this-mo.O 2> this-mo.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test this-mo(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp this-mo.O $srcdir/this-mo.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed this-mo(LANG=C TZ=UTC)"; fi ;;
+ 1) $echo "Test this-mo(LANG=C TZ=UTC) failed: files this-mo.O and $srcdir/this-mo.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test this-mo(LANG=C TZ=UTC) may have failed." 1>&2;
+ $echo The command "cmp this-mo.O $srcdir/this-mo.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s this-mo.E || rm -f this-mo.E
+LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 this year' '+%Y-%m-%d %T' > this-y.O 2> this-y.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test this-y(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp this-y.O $srcdir/this-y.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed this-y(LANG=C TZ=UTC)"; fi ;;
+ 1) $echo "Test this-y(LANG=C TZ=UTC) failed: files this-y.O and $srcdir/this-y.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test this-y(LANG=C TZ=UTC) may have failed." 1>&2;
+ $echo The command "cmp this-y.O $srcdir/this-y.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s this-y.E || rm -f this-y.E
+LANG=C TZ=UTC $xx -d 'Nov 10 1996' '+%Y-%m-%d %T' > risks-1.O 2> risks-1.E
+code=$?
+if test $code != 0 ; then
+ $echo "Test risks-1(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp risks-1.O $srcdir/risks-1.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo "passed risks-1(LANG=C TZ=UTC)"; fi ;;
+ 1) $echo "Test risks-1(LANG=C TZ=UTC) failed: files risks-1.O and $srcdir/risks-1.X differ" 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo "Test risks-1(LANG=C TZ=UTC) may have failed." 1>&2;
+ $echo The command "cmp risks-1.O $srcdir/risks-1.X" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s risks-1.E || rm -f risks-1.E
if test $errors = 0 ; then
- $echo Passed all 49 tests. 1>&2
+ $echo Passed all 55 tests. 1>&2
else
$echo Failed $errors tests. 1>&2
fi