mirror of
https://https.git.savannah.gnu.org/git/diffutils.git
synced 2026-01-27 01:44:20 +00:00
tests: add test for --strip-trailing-cr UMR bug
* tests/strip-trailing-cr: New file. Test for today's bug fix. * tests/Makefile.am (TESTS): Add it.
This commit is contained in:
parent
a28327bd77
commit
c7a4eacac9
@ -21,6 +21,7 @@ TESTS = \
|
||||
stdin \
|
||||
strcoll-0-names \
|
||||
filename-quoting \
|
||||
strip-trailing-cr \
|
||||
colors
|
||||
|
||||
XFAIL_TESTS = large-subopt
|
||||
|
||||
20
tests/strip-trailing-cr
Executable file
20
tests/strip-trailing-cr
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
# Before diff-3.7, this would provoke a UMR
|
||||
|
||||
. "${srcdir=.}/init.sh"; path_prepend_ ../src
|
||||
|
||||
fail=0
|
||||
|
||||
require_valgrind_
|
||||
|
||||
printf '\r' > r || framework_failure_
|
||||
echo b > b || framework_failure_
|
||||
|
||||
for opt in '' u c Dfoo; do
|
||||
returns_ 1 valgrind --quiet --error-exitcode=3 \
|
||||
diff -a$opt --strip-trailing-cr r b > out 2> err || fail=1
|
||||
done
|
||||
|
||||
compare /dev/null err || fail=1
|
||||
|
||||
Exit $fail
|
||||
Loading…
x
Reference in New Issue
Block a user