summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2017-05-02 19:52:37 -0700
committerJim Meyering <meyering@fb.com>2017-05-02 20:00:50 -0700
commit4e40686e23dba2e89aec76ee009049602caa19ca (patch)
tree3e0852ab7ebd137113c37e362513a827e055bc7c /tests
parentaf6d2e0dbddcdcd52ba36636c72b3ffa774238c8 (diff)
downloaddiffutils-4e40686e23dba2e89aec76ee009049602caa19ca.tar.gz
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am1
-rwxr-xr-xtests/invalid-re18
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 66e25a5..2c44609 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -9,6 +9,7 @@ TESTS = \
diff3 \
excess-slash \
help-version \
+ invalid-re \
function-line-vs-leading-space \
ignore-matching-lines \
label-vs-func \
diff --git a/tests/invalid-re b/tests/invalid-re
new file mode 100755
index 0000000..0732a1f
--- /dev/null
+++ b/tests/invalid-re
@@ -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