summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2022-12-19 13:46:14 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2022-12-19 13:47:19 -0800
commit602c0cb92c50a259c29138d8e107615569c0767d (patch)
treef24c9ef2e1ab6e2181534990e8140ff7c2f4507e
parenta9b1b679b6cbe94087708fe8957979182d501528 (diff)
downloadsed-602c0cb92c50a259c29138d8e107615569c0767d.tar.gz
maint: add test cases for integer overflow
* testsuite/execute-tests.sh: Add some tests with enormous integers.
-rw-r--r--testsuite/execute-tests.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/execute-tests.sh b/testsuite/execute-tests.sh
index 6c9668c..1a2544f 100644
--- a/testsuite/execute-tests.sh
+++ b/testsuite/execute-tests.sh
@@ -71,6 +71,19 @@ printf "%s\n" a | sed -n 'P' > out7 || fail=1
compare_ in6 out7 || fail=1
#
+# 'q' and other commands with big numbers (2**256 + 1, 2 ** 256 + 2)
+#
+big1=115792089237316195423570985008687907853269984665640564039457584007913129639937
+big2=115792089237316195423570985008687907853269984665640564039457584007913129639938
+printf '%s\n' a b >in7a || framework_failure_
+sed ${big1}q in7a >out7a1 || fail=1
+compare_ in7a out7a1 || fail=1
+sed -n 1,${big1}p in7a >out7a2 || fail=1
+compare_ in7a out7a2 || fail=1
+sed ${big1},${big2}d in7a >out7a3 || fail=1
+compare_ in7a out7a3 || fail=1
+
+#
# 'Q' with exit code
#
echo a > in7 || framework_failure_