diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 01:16:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 01:16:24 +0000 |
commit | 9221dca64f0c8b5de72727491e41cf63e902eaab (patch) | |
tree | d8cbbf520eb4b5c656a54b2e36947008dcb751ad /src/tests/man-8 | |
parent | Initial commit. (diff) | |
download | man-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/man-8')
-rwxr-xr-x | src/tests/man-8 | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/tests/man-8 b/src/tests/man-8 new file mode 100755 index 0000000..cb19790 --- /dev/null +++ b/src/tests/man-8 @@ -0,0 +1,58 @@ +#! /bin/sh + +# Test additional language-specific requests for localized man pages. + +: ${srcdir=.} +. "$srcdir/testlib.sh" + +: ${MAN=man} + +init +fake_config /usr/share/man +MANPATH="$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' + +write_page test 1 "$tmpdir/usr/share/man/xyzzy/man1/test.1" \ + UTF-8 '' '' 'test \- xyzzy language page for test' + +write_page xyz 1 "$tmpdir/usr/share/man/man1/xyz.1" \ + UTF-8 '' '' 'test \- top-level xyz page' + +cat >"$tmpdir/1.exp" <<'EOF' +. mso xyzzy.tmac +.hla xyzzy +test \- xyzzy language page for test +EOF + +cat >"$tmpdir/2.exp" <<'EOF' +.TH xyz 1 +test \- top-level xyz page +EOF + +run $MAN -L xyzzy_foo.bar -C "$tmpdir/manpath.config" test |\ + grep 'xyzzy' >"$tmpdir/1.out" +expect_pass 'language-specific requests for localized man page' \ + 'diff -u "$tmpdir/1.exp" "$tmpdir/1.out"' + +run $MAN -L xyzzy_foo.bar -C "$tmpdir/manpath.config" xyz |\ + grep 'xyz' >"$tmpdir/2.out" +expect_pass 'no language-specific requests for top-level man page' \ + 'diff -u "$tmpdir/2.exp" "$tmpdir/2.out"' + +finish |