summaryrefslogtreecommitdiffstats
path: root/src/tests/man-invalid-db-entry
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/man-invalid-db-entry')
-rwxr-xr-xsrc/tests/man-invalid-db-entry31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/tests/man-invalid-db-entry b/src/tests/man-invalid-db-entry
new file mode 100755
index 0000000..ef24716
--- /dev/null
+++ b/src/tests/man-invalid-db-entry
@@ -0,0 +1,31 @@
+#! /bin/sh
+
+# Test for invalid DB entry.
+# https://bugzilla.redhat.com/show_bug.cgi?id=841431
+
+: "${srcdir=.}"
+# shellcheck source-path=SCRIPTDIR
+. "$srcdir/testlib.sh"
+
+: "${MAN=man}"
+: "${MANDB=mandb}"
+
+init
+fake_config /usr/share/man
+MANPATH="$tmpdir/usr/share/man"
+export MANPATH
+
+MAN_TEST_DISABLE_UNDOCUMENTED=1
+export MAN_TEST_DISABLE_UNDOCUMENTED
+
+write_page test 1 "$tmpdir/usr/share/man/man1/test.1" \
+ UTF-8 '' '' 'test \- top-level test page'
+run $MANDB -C "$tmpdir/manpath.config" -u -q "$tmpdir/usr/share/man"
+
+rm -f "$tmpdir/usr/share/man/man1/test.1"
+
+echo "No manual entry for test" > "$tmpdir/1.exp"
+LC_ALL=C run $MAN -C "$tmpdir/manpath.config" test 2> "$tmpdir/1.out"
+expect_files_equal 'invalid DB entry' "$tmpdir/1.exp" "$tmpdir/1.out"
+
+finish