summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2023-04-03 11:41:26 -0700
committerJim Meyering <meyering@meta.com>2023-04-09 22:22:42 -0700
commit19d2275fd1195f00e4ffc90a03b388c55d858681 (patch)
tree7aac3d9b47a961a486b1d28230e60872df22e286
parent488a115bfeb43857f0085f154a4869f0a8ad3e6c (diff)
downloadgrep-19d2275fd1195f00e4ffc90a03b388c55d858681.tar.gz
tests: test for the year-2038 bug
* tests/y2038-vs-32-bit: New file. * tests/Makefile.am (TESTS): Add the file name
-rw-r--r--tests/Makefile.am1
-rwxr-xr-xtests/y2038-vs-32-bit13
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f195c8da..c9376b19 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -183,6 +183,7 @@ TESTS = \
word-multi-file \
word-multibyte \
write-error-msg \
+ y2038-vs-32-bit \
yesno \
z-anchor-newline
diff --git a/tests/y2038-vs-32-bit b/tests/y2038-vs-32-bit
new file mode 100755
index 00000000..374f855a
--- /dev/null
+++ b/tests/y2038-vs-32-bit
@@ -0,0 +1,13 @@
+#!/bin/sh
+# This would fail with grep-3.9 and 3.10 on 32-bit ARM and x86 hosts.
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+fail=0
+
+echo text > in || framework_failure_
+touch -t 203901010000 in || framework_failure_
+grep t in > out 2> err || fail=1
+compare in out || fail=1
+compare /dev/null err || fail=1
+
+Exit $fail