summaryrefslogtreecommitdiffstats
path: root/src/tests/mandb-5
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:16:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:16:24 +0000
commit9221dca64f0c8b5de72727491e41cf63e902eaab (patch)
treed8cbbf520eb4b5c656a54b2e36947008dcb751ad /src/tests/mandb-5
parentInitial commit. (diff)
downloadman-db-9221dca64f0c8b5de72727491e41cf63e902eaab.tar.xz
man-db-9221dca64f0c8b5de72727491e41cf63e902eaab.zip
Adding upstream version 2.8.5.upstream/2.8.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tests/mandb-5')
-rwxr-xr-xsrc/tests/mandb-530
1 files changed, 30 insertions, 0 deletions
diff --git a/src/tests/mandb-5 b/src/tests/mandb-5
new file mode 100755
index 0000000..88e6ad0
--- /dev/null
+++ b/src/tests/mandb-5
@@ -0,0 +1,30 @@
+#! /bin/sh
+
+# Test handling of empty files.
+# https://bugs.debian.org/622104
+
+: ${srcdir=.}
+. "$srcdir/testlib.sh"
+
+: ${MANDB=mandb}
+
+init
+fake_config /usr/share/man /usr/X11R6/man
+MANPATH="$tmpdir/usr/share/man"
+export MANPATH
+db_ext="$(db_ext)"
+
+mkdir -p "$tmpdir/usr/share/man/man1"
+touch "$tmpdir/usr/share/man/man1/empty.1"
+gzip -9 "$tmpdir/usr/share/man/man1/empty.1"
+run $MANDB -C "$tmpdir/manpath.config" -u -q "$tmpdir/usr/share/man"
+# $? is deliberately expanded here.
+expect_pass 'empty page' "test $? -eq 0"
+
+./fspause
+ln -s empty.1.gz "$tmpdir/usr/share/man/man1/empty2.1.gz"
+run $MANDB -C "$tmpdir/manpath.config" -u -q "$tmpdir/usr/share/man"
+# $? is deliberately expanded here.
+expect_pass 'symlink to empty page' "test $? -eq 0"
+
+finish