summaryrefslogtreecommitdiffstats
path: root/src/tests/man-override-dir
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-override-dir
parentInitial commit. (diff)
downloadman-db-74b60c5712f2a84904b95d008953c140a9bd5dd2.tar.xz
man-db-74b60c5712f2a84904b95d008953c140a9bd5dd2.zip
Adding upstream version 2.9.4.upstream/2.9.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xsrc/tests/man-override-dir46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/tests/man-override-dir b/src/tests/man-override-dir
new file mode 100755
index 0000000..4dc0331
--- /dev/null
+++ b/src/tests/man-override-dir
@@ -0,0 +1,46 @@
+#! /bin/sh
+
+# Testing override dir. This test covers both use cases - when override dir is
+# enabled and when it's not.
+#
+
+: ${srcdir=.}
+. "$srcdir/testlib.sh"
+
+: ${MAN=man}
+
+if [ -n "$OVERRIDE_DIR" ]; then
+ OVERRIDE=$OVERRIDE_DIR
+else
+ OVERRIDE="override"
+fi
+
+init
+fake_config /usr/share/man
+mkdir -p "${tmpdir}/usr/share/man/${OVERRIDE}/man1"
+MANPATH="$tmpdir/usr/share/man"
+export MANPATH
+
+
+write_page abc 1 "${tmpdir}/usr/share/man/man1/abc.1" \
+ UTF-8 '' '' 'abc \- top-level test page'
+write_page abc 1 "${tmpdir}/usr/share/man/${OVERRIDE}/man1/abc.1" \
+ UTF-8 '' '' 'abc \- modified test page'
+
+if [ -n "$OVERRIDE_DIR" ]; then
+cat >"$tmpdir/1.exp" <<EOF
+$abstmpdir/usr/share/man/${OVERRIDE}/man1/abc.1
+$abstmpdir/usr/share/man/man1/abc.1
+EOF
+else
+cat >"$tmpdir/1.exp" <<EOF
+$abstmpdir/usr/share/man/man1/abc.1
+EOF
+fi
+
+
+run $MAN -C "$tmpdir/manpath.config" -aw abc >"$tmpdir/1.out"
+expect_pass 'testing override dir' \
+ 'diff -u "$tmpdir/1.exp" "$tmpdir/1.out"'
+
+finish