summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-08-14 17:13:28 -0500
committerJim Meyering <meyering@redhat.com>2010-08-14 17:15:57 -0500
commit53de393ca335e77f22d3789100734c87868f12b3 (patch)
treeee89c725bed3856568395d3260d3ad33d40c5231 /tests
parentf2ad578b241713fa81d98b3573fa42397d2ea3f8 (diff)
downloaddiffutils-53de393ca335e77f22d3789100734c87868f12b3.tar.gz
diff -r: avoid printing excess slashes in concatenated file names
* bootstrap.conf (gnulib_modules): Add filenamecat. * src/diff.c: Include "filenamecat.h". (compare_files): Use file_name_concat, rather than dir_file_pathname. * src/util.c (dir_file_pathname): Remove now-unused function. * src/diff.h: Remove its declaration. * tests/excess-slash: New script to test for this. * tests/Makefile.am (TESTS): Add it. Forwarded by Santiago Vila from <bugs.debian.org/586301a>, reported by Jari Aalto.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am3
-rw-r--r--tests/excess-slash19
2 files changed, 21 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 242d501..190f16a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,7 +1,8 @@
-TESTS = \
+jESTS = \
basic \
binary \
colliding-file-names \
+ excess-slash \
help-version \
function-line-vs-leading-space \
label-vs-func \
diff --git a/tests/excess-slash b/tests/excess-slash
new file mode 100644
index 0000000..3ef34cc
--- /dev/null
+++ b/tests/excess-slash
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Ensure that no excess slash appears in diff -r output.
+
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ ../src
+
+mkdir -p a/f b/f/g || framework_failure_
+echo Only in b/f: g > expected-out || framework_failure_
+
+fail=0
+
+diff -r a b/ > out 2> err && fail=1
+
+# expect no stderr
+compare err /dev/null || fail=1
+
+compare out expected-out || fail=1
+
+Exit $fail