mirror of
https://https.git.savannah.gnu.org/git/diffutils.git
synced 2026-01-27 09:54:25 +00:00
tests: add test for latest fix
* NEWS (Bug fixes): Describe it. * tests/invalid-re: New test for just-fixed bug. * tests/Makefile.am (TESTS): Add it.
This commit is contained in:
parent
af6d2e0dbd
commit
4e40686e23
6
NEWS
6
NEWS
@ -4,6 +4,12 @@ GNU diffutils NEWS -*- outline -*-
|
||||
|
||||
** Bug fixes
|
||||
|
||||
Using an invalid regular expression with --ignore-matching-lines=RE (-I)
|
||||
no longer causes stack overflow. Before, with an invocation like the
|
||||
following, diff would diagnose the error, but would still proceed to
|
||||
blow the stack: diff -Ia -I\\ <(echo) <(echo b)
|
||||
[bug introduced in 2.9]
|
||||
|
||||
diff no longer mishandles line numbers exceeding 2**31 on Mingw-w64.
|
||||
|
||||
the ---presume-output-tty (ostensibly test-only) option would cause
|
||||
|
||||
@ -9,6 +9,7 @@ TESTS = \
|
||||
diff3 \
|
||||
excess-slash \
|
||||
help-version \
|
||||
invalid-re \
|
||||
function-line-vs-leading-space \
|
||||
ignore-matching-lines \
|
||||
label-vs-func \
|
||||
|
||||
18
tests/invalid-re
Executable file
18
tests/invalid-re
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# Ensure we diagnose and fail upon first invalid -I regex.
|
||||
|
||||
. "${srcdir=.}/init.sh"; path_prepend_ ../src
|
||||
|
||||
fail=0
|
||||
|
||||
echo > a || framework_failure_
|
||||
echo b > b || framework_failure_
|
||||
echo 'diff: \: Trailing backslash' > exp-err || framework_failure_
|
||||
|
||||
# This must fail with an exit status of 2:
|
||||
returns_ 2 diff -Ix -I\\ a b > out 2> err || fail=1
|
||||
|
||||
compare /dev/null out || fail=1
|
||||
compare exp-err err || fail=1
|
||||
|
||||
Exit $fail
|
||||
Loading…
x
Reference in New Issue
Block a user