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-mandatory-manpath | 189 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100755 src/tests/man-mandatory-manpath (limited to 'src/tests/man-mandatory-manpath') diff --git a/src/tests/man-mandatory-manpath b/src/tests/man-mandatory-manpath new file mode 100755 index 0000000..af76ff0 --- /dev/null +++ b/src/tests/man-mandatory-manpath @@ -0,0 +1,189 @@ +#! /bin/sh + +# Test for wildcards in MANDATORY_MANPATH in config file and in MANPATH. +# https://bugzilla.redhat.com/show_bug.cgi?id=677669 + +: "${srcdir=.}" +# shellcheck source-path=SCRIPTDIR +. "$srcdir/testlib.sh" + +: "${MAN=man}" + +init +: > "$tmpdir/manpath.config" + +MAN_TEST_DISABLE_PATH=1 +export MAN_TEST_DISABLE_PATH + +write_page manx 1 "$tmpdir/usr/share/man/man1/manx.1.gz" \ + UTF-8 gz '' 'manx \- an interface to the system reference manuals' +write_page manpathx 1 "$tmpdir/usr/share/prog/a/man/man1/manpathx.1.gz" \ + UTF-8 gz '' 'manpathx \- determine search path for manual pages' +write_page whatisx 1 "$tmpdir/usr/share/prog/b/man/man1/whatisx.1.gz" \ + UTF-8 gz '' 'whatisx \- display manual page descriptions' + +# +# Testing -M option +# + +# Without wildcards +Mpath="$tmpdir/usr/share/man" + +run $MAN -C "$tmpdir/manpath.config" \ + -aw -M "${Mpath}" manpathx > "$tmpdir/1.out" 2> /dev/null +: > "$tmpdir/1.exp" +expect_files_equal \ + 'wildcards: -M option: without wildcards: check missing man page' \ + "$tmpdir/1.exp" "$tmpdir/1.out" + +run $MAN -C "$tmpdir/manpath.config" \ + -aw -M "${Mpath}" manx > "$tmpdir/1.out" +cat > "$tmpdir/1.exp" < "$tmpdir/1.out" 2> /dev/null +: > "$tmpdir/1.exp" +expect_files_equal \ + 'wildcards: -M option: with wildcards: check missing man page' \ + "$tmpdir/1.exp" "$tmpdir/1.out" + +run $MAN -C "$tmpdir/manpath.config" \ + -aw -M "${Mpath}" manpathx > "$tmpdir/1.out" +cat > "$tmpdir/1.exp" < "$tmpdir/1.out" +cat > "$tmpdir/1.exp" < "$tmpdir/1.out" 2> /dev/null +: > "$tmpdir/1.exp" +expect_files_equal \ + 'wildcards: MANPATH: without wildcards: check missing man page' \ + "$tmpdir/1.exp" "$tmpdir/1.out" + +run $MAN -C "$tmpdir/manpath.config" \ + -aw manx > "$tmpdir/1.out" +cat > "$tmpdir/1.exp" < "$tmpdir/1.out" 2> /dev/null +: > "$tmpdir/1.exp" +expect_files_equal \ + 'wildcards: MANPATH: with wildcards: check missing man page' \ + "$tmpdir/1.exp" "$tmpdir/1.out" + +run $MAN -C "$tmpdir/manpath.config" \ + -aw manpathx > "$tmpdir/1.out" +cat > "$tmpdir/1.exp" < "$tmpdir/1.out" +cat > "$tmpdir/1.exp" < "$tmpdir/1.out" 2> /dev/null +: > "$tmpdir/1.exp" +expect_files_equal \ + 'wildcards: MANDATORY_MANPATH: without wildcards: check missing man page' \ + "$tmpdir/1.exp" "$tmpdir/1.out" + +run $MAN -C "$tmpdir/manpath.config" \ + -aw manx > "$tmpdir/1.out" +cat > "$tmpdir/1.exp" < "$tmpdir/1.out" 2> /dev/null +: > "$tmpdir/1.exp" +expect_files_equal \ + 'wildcards: MANDATORY_MANPATH: with wildcards: check missing man page' \ + "$tmpdir/1.exp" "$tmpdir/1.out" + +run $MAN -C "$tmpdir/manpath.config" \ + -aw manpathx > "$tmpdir/1.out" +cat > "$tmpdir/1.exp" < "$tmpdir/1.out" +cat > "$tmpdir/1.exp" <