summaryrefslogtreecommitdiff
path: root/tests/date
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-03-17 18:44:57 +0000
committerJim Meyering <jim@meyering.net>2004-03-17 18:44:57 +0000
commitc420f0b4370614a18da9e5a962148f97386bffdc (patch)
tree28cb68176ef205f449d37920762f8405254b6593 /tests/date
parent12b6a3e366920352cfeefc1489b4850a2660f56b (diff)
downloadcoreutils-c420f0b4370614a18da9e5a962148f97386bffdc.tar.xz
.
Diffstat (limited to 'tests/date')
-rw-r--r--tests/date/Makefile.am7
-rw-r--r--tests/date/Makefile.in7
-rwxr-xr-xtests/date/date-tests74
3 files changed, 83 insertions, 5 deletions
diff --git a/tests/date/Makefile.am b/tests/date/Makefile.am
index b625f9d06..5904267f7 100644
--- a/tests/date/Makefile.am
+++ b/tests/date/Makefile.am
@@ -10,7 +10,8 @@ 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 this-m.X \
this-h.X this-w.X this-mo.X this-y.X risks-1.X regress-1.X datevtime-1.X \
-rfc822-1.X relative-1.X relative-2.X wide-fmt.X moname-d-y.X
+rfc822-1.X relative-1.X relative-2.X wide-fmt.X moname-d-y.X epoch.X ns-10.X \
+ns-max32.X ns-relative.X
run_gen = 1.O 1.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 \
@@ -25,7 +26,9 @@ date2sec-0a.O date2sec-0a.E date2sec-1.O date2sec-1.E sec2date-0.O \
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 regress-1.O regress-1.E \
datevtime-1.O datevtime-1.E rfc822-1.O rfc822-1.E relative-1.O relative-1.E \
-relative-2.O relative-2.E wide-fmt.O wide-fmt.E moname-d-y.O moname-d-y.E
+relative-2.O relative-2.E wide-fmt.O wide-fmt.E moname-d-y.O moname-d-y.E \
+epoch.O epoch.E ns-10.O ns-10.E ns-max32.O ns-max32.E ns-relative.O \
+ns-relative.E
##test-files-end
EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
diff --git a/tests/date/Makefile.in b/tests/date/Makefile.in
index e04c1b632..cd6295971 100644
--- a/tests/date/Makefile.in
+++ b/tests/date/Makefile.in
@@ -268,7 +268,8 @@ 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 this-m.X \
this-h.X this-w.X this-mo.X this-y.X risks-1.X regress-1.X datevtime-1.X \
-rfc822-1.X relative-1.X relative-2.X wide-fmt.X moname-d-y.X
+rfc822-1.X relative-1.X relative-2.X wide-fmt.X moname-d-y.X epoch.X ns-10.X \
+ns-max32.X ns-relative.X
run_gen = 1.O 1.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 \
@@ -284,7 +285,9 @@ date2sec-0a.O date2sec-0a.E date2sec-1.O date2sec-1.E sec2date-0.O \
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 regress-1.O regress-1.E \
datevtime-1.O datevtime-1.E rfc822-1.O rfc822-1.E relative-1.O relative-1.E \
-relative-2.O relative-2.E wide-fmt.O wide-fmt.E moname-d-y.O moname-d-y.E
+relative-2.O relative-2.E wide-fmt.O wide-fmt.E moname-d-y.O moname-d-y.E \
+epoch.O epoch.E ns-10.O ns-10.E ns-max32.O ns-max32.E ns-relative.O \
+ns-relative.E
EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
noinst_SCRIPTS = $x-tests
diff --git a/tests/date/date-tests b/tests/date/date-tests
index 2c0878ed1..88b0d4571 100755
--- a/tests/date/date-tests
+++ b/tests/date/date-tests
@@ -1116,8 +1116,80 @@ else
esac
fi
test -s moname-d-y.E || rm -f moname-d-y.E
+LANG=C TZ=UTC0 $xx --iso=sec -d @31536000 > epoch.O 2> epoch.E
+code=$?
+if test $code != 0; then
+ $echo "Test epoch(LANG=C TZ=UTC0) failed: $xx return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp epoch.O $srcdir/epoch.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed epoch(LANG=C TZ=UTC0)"; fi;;
+ 1) $echo "Test epoch(LANG=C TZ=UTC0) failed: files epoch.O and $srcdir/epoch.X differ" 1>&2
+ (diff -c epoch.O $srcdir/epoch.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test epoch(LANG=C TZ=UTC0) may have failed." 1>&2
+ $echo The command "cmp epoch.O $srcdir/epoch.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s epoch.E || rm -f epoch.E
+LANG=C TZ=UTC0 $xx --iso=ns -d "1969-12-31 13:00:00.00000001-1100" > ns-10.O 2> ns-10.E
+code=$?
+if test $code != 0; then
+ $echo "Test ns-10(LANG=C TZ=UTC0) failed: $xx return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp ns-10.O $srcdir/ns-10.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed ns-10(LANG=C TZ=UTC0)"; fi;;
+ 1) $echo "Test ns-10(LANG=C TZ=UTC0) failed: files ns-10.O and $srcdir/ns-10.X differ" 1>&2
+ (diff -c ns-10.O $srcdir/ns-10.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test ns-10(LANG=C TZ=UTC0) may have failed." 1>&2
+ $echo The command "cmp ns-10.O $srcdir/ns-10.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s ns-10.E || rm -f ns-10.E
+LANG=C TZ=UTC0 $xx --iso=ns -d "2038-01-19 03:14:07.999999999" > ns-max32.O 2> ns-max32.E
+code=$?
+if test $code != 0; then
+ $echo "Test ns-max32(LANG=C TZ=UTC0) failed: $xx return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp ns-max32.O $srcdir/ns-max32.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed ns-max32(LANG=C TZ=UTC0)"; fi;;
+ 1) $echo "Test ns-max32(LANG=C TZ=UTC0) failed: files ns-max32.O and $srcdir/ns-max32.X differ" 1>&2
+ (diff -c ns-max32.O $srcdir/ns-max32.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test ns-max32(LANG=C TZ=UTC0) may have failed." 1>&2
+ $echo The command "cmp ns-max32.O $srcdir/ns-max32.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s ns-max32.E || rm -f ns-max32.E
+LANG=C TZ=UTC0 $xx --iso=ns -d'1970-01-01 00:00:00.1234567 UTC +961062237.987654321 sec' > ns-relative.O 2> ns-relative.E
+code=$?
+if test $code != 0; then
+ $echo "Test ns-relative(LANG=C TZ=UTC0) failed: $xx return code $code differs from expected value 0" 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp ns-relative.O $srcdir/ns-relative.X > /dev/null 2>&1
+ case $? in
+ 0) if test "$VERBOSE"; then $echo "passed ns-relative(LANG=C TZ=UTC0)"; fi;;
+ 1) $echo "Test ns-relative(LANG=C TZ=UTC0) failed: files ns-relative.O and $srcdir/ns-relative.X differ" 1>&2
+ (diff -c ns-relative.O $srcdir/ns-relative.X) 2> /dev/null
+ errors=`expr $errors + 1`;;
+ 2) $echo "Test ns-relative(LANG=C TZ=UTC0) may have failed." 1>&2
+ $echo The command "cmp ns-relative.O $srcdir/ns-relative.X" failed. 1>&2
+ errors=`expr $errors + 1`;;
+ esac
+fi
+test -s ns-relative.E || rm -f ns-relative.E
if test $errors = 0; then
- $echo Passed all 61 tests. 1>&2
+ $echo Passed all 65 tests. 1>&2
else
$echo Failed $errors tests. 1>&2
fi