summaryrefslogtreecommitdiffstats
path: root/src/tests/man-symlinks-with-matching-names
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:37:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:37:10 +0000
commitc9addba5cc770d2d231b34f6739f32c6be8690f1 (patch)
treec643da154a95a1d163137135050bb47858a1654e /src/tests/man-symlinks-with-matching-names
parentInitial commit. (diff)
downloadman-db-c9addba5cc770d2d231b34f6739f32c6be8690f1.tar.xz
man-db-c9addba5cc770d2d231b34f6739f32c6be8690f1.zip
Adding upstream version 2.12.0.upstream/2.12.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tests/man-symlinks-with-matching-names')
-rwxr-xr-xsrc/tests/man-symlinks-with-matching-names32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/tests/man-symlinks-with-matching-names b/src/tests/man-symlinks-with-matching-names
new file mode 100755
index 0000000..f8c3bb8
--- /dev/null
+++ b/src/tests/man-symlinks-with-matching-names
@@ -0,0 +1,32 @@
+#! /bin/sh
+
+# Test for:
+# https://bugs.debian.org/163347
+
+: "${srcdir=.}"
+# shellcheck source-path=SCRIPTDIR
+. "$srcdir/testlib.sh"
+
+: "${MAN=man}"
+
+init
+fake_config /usr/local/man /usr/share/man
+MANPATH="$tmpdir/usr/local/man:$tmpdir/usr/share/man"
+export MANPATH
+
+write_page md5sum 1 "$tmpdir/usr/share/man/man1/md5sum.1.gz" \
+ UTF-8 gz '' 'md5sum \- Debian md5sum manual page'
+write_page md5sum 1 "$tmpdir/usr/share/man/man1/md5sum.textutils.1.gz" \
+ UTF-8 gz '' 'md5sum \- coreutils md5sum manual page'
+mkdir -p "$tmpdir/usr/local/man/man1"
+ln -s ../../../share/man/man1/md5sum.textutils.1.gz \
+ "$tmpdir/usr/local/man/man1/md5sum.1.gz"
+cat >"$tmpdir/1.exp" <<EOF
+$abstmpdir/usr/share/man/man1/md5sum.textutils.1.gz
+$abstmpdir/usr/share/man/man1/md5sum.1.gz
+EOF
+run $MAN -C "$tmpdir/manpath.config" -aw md5sum >"$tmpdir/1.out"
+expect_files_equal 'symlinks with matching names win' \
+ "$tmpdir/1.exp" "$tmpdir/1.out"
+
+finish