summaryrefslogtreecommitdiffstats
path: root/src/tests/man-deleted-directory
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 10:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 10:49:50 +0000
commit74b60c5712f2a84904b95d008953c140a9bd5dd2 (patch)
treedd12cc58c6d4cfb5e2c1183f47757295ce3b5662 /src/tests/man-deleted-directory
parentInitial commit. (diff)
downloadman-db-upstream.tar.xz
man-db-upstream.zip
Adding upstream version 2.9.4.upstream/2.9.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tests/man-deleted-directory')
-rwxr-xr-xsrc/tests/man-deleted-directory26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/tests/man-deleted-directory b/src/tests/man-deleted-directory
new file mode 100755
index 0000000..75ec2a5
--- /dev/null
+++ b/src/tests/man-deleted-directory
@@ -0,0 +1,26 @@
+#! /bin/sh
+
+# Test that man can run from a deleted directory.
+# https://bugs.debian.org/764384
+
+: ${srcdir=.}
+. "$srcdir/testlib.sh"
+
+: ${MAN=man}
+
+init
+echo "MANDATORY_MANPATH $abstmpdir/usr/share/man" >"$tmpdir/manpath.config"
+MANPATH="$abstmpdir/usr/share/man"
+export MANPATH
+
+write_page test 1 "$tmpdir/usr/share/man/man1/test.1" \
+ UTF-8 '' '' 'test \- test'
+mkdir "$tmpdir/zombie"
+cd "$tmpdir/zombie"
+rmdir "$abstmpdir/zombie" || \
+ skip "can't remove current working directory on this system"
+run $MAN -C "$abstmpdir/manpath.config" test >/dev/null
+code=$?
+expect_pass 'run from deleted directory' 'test "$code" = 0'
+
+finish