From e0023883c6d2e6745a19e4b48e186ed156c1fca8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:19:27 +0200 Subject: Adding upstream version 2.11.2. Signed-off-by: Daniel Baumann --- src/tests/man-language-specific-requests | 65 ++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 src/tests/man-language-specific-requests (limited to 'src/tests/man-language-specific-requests') diff --git a/src/tests/man-language-specific-requests b/src/tests/man-language-specific-requests new file mode 100755 index 0000000..5051d50 --- /dev/null +++ b/src/tests/man-language-specific-requests @@ -0,0 +1,65 @@ +#! /bin/sh + +# Test additional language-specific requests for localized man pages. + +: "${srcdir=.}" +# shellcheck source-path=SCRIPTDIR +. "$srcdir/testlib.sh" + +: "${MAN=man}" + +init +fake_config /usr/share/man +MANPATH="$tmpdir/usr/share/man" +export MANPATH + +cat >"$tmpdir/fake-program" <>"$tmpdir/manpath.config" <"$tmpdir/1.exp" +# shellcheck disable=SC2154 +if [ "$troff_is_groff" = yes ]; then + cat >>"$tmpdir/1.exp" <<'EOF' +. mso xyzzy.tmac +.hla xyzzy +EOF +fi +cat >>"$tmpdir/1.exp" <<'EOF' +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_files_equal 'language-specific requests for localized man page' \ + "$tmpdir/1.exp" "$tmpdir/1.out" + +run $MAN -L xyzzy_foo.bar -C "$tmpdir/manpath.config" xyz |\ + grep 'xyz' >"$tmpdir/2.out" +expect_files_equal 'no language-specific requests for top-level man page' \ + "$tmpdir/2.exp" "$tmpdir/2.out" + +finish -- cgit v1.2.3