summaryrefslogtreecommitdiffstats
path: root/src/tests/zsoelim-so-includes
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/zsoelim-so-includes
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/zsoelim-so-includes61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/tests/zsoelim-so-includes b/src/tests/zsoelim-so-includes
new file mode 100755
index 0000000..311bf16
--- /dev/null
+++ b/src/tests/zsoelim-so-includes
@@ -0,0 +1,61 @@
+#! /bin/sh
+
+# Test for:
+# https://bugs.debian.org/503472
+
+: ${srcdir=.}
+. "$srcdir/testlib.sh"
+
+: ${MAN=man}
+
+init
+fake_config /usr/local/man /usr/share/man
+MANPATH="$tmpdir/usr/local/man:$tmpdir/usr/share/man"
+export MANPATH
+
+cat >"$tmpdir/fake-program" <<EOF
+#! /bin/sh
+exec cat
+EOF
+chmod +x "$tmpdir/fake-program"
+PATH="$abstmpdir:$PATH"
+export PATH
+
+cat >>"$tmpdir/manpath.config" <<EOF
+DEFINE tbl fake-program
+DEFINE nroff fake-program
+EOF
+
+write_page test 1 "$tmpdir/usr/share/man/man1/test.1" \
+ UTF-8 '' '' 'test \- top-level test page'
+echo '.so man7/test2.7' >>"$tmpdir/usr/share/man/man1/test.1"
+write_page test2 7 "$tmpdir/usr/local/man/man7/test2.7" \
+ UTF-8 '' '' 'test2 \- second-level local test page'
+echo '.so test3.1' >>"$tmpdir/usr/local/man/man7/test2.7"
+write_page test3 1 "$tmpdir/usr/local/man/man1/test3.1" \
+ UTF-8 '' '' 'test3 \- third-level local test page'
+write_page test3 1 "$tmpdir/usr/share/man/man1/test3.1" \
+ UTF-8 '' '' 'test3 \- third-level test page'
+cat >"$tmpdir/1.exp" <<'EOF'
+.TH test 1
+.SH NAME
+test \- top-level test page
+.SH DESCRIPTION
+test
+.TH test2 7
+.SH NAME
+test2 \- second-level local test page
+.SH DESCRIPTION
+test
+.TH test3 1
+.SH NAME
+test3 \- third-level test page
+.SH DESCRIPTION
+test
+EOF
+run $MAN -C "$tmpdir/manpath.config" test | \
+ grep -v '^\.l[flt] ' >"$tmpdir/1.out"
+expect_pass 'test(1) expanded correctly' \
+ 'diff -u "$tmpdir/1.exp" "$tmpdir/1.out"'
+
+finish