summaryrefslogtreecommitdiffstats
path: root/src/tests/man-10
blob: 75ec2a569cb82c5f8d93d31ccaf424a7547975f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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