From 74b60c5712f2a84904b95d008953c140a9bd5dd2 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 12:49:50 +0200 Subject: Adding upstream version 2.9.4. Signed-off-by: Daniel Baumann --- src/tests/man-mandatory-manpath | 173 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 173 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..75633ac --- /dev/null +++ b/src/tests/man-mandatory-manpath @@ -0,0 +1,173 @@ +#! /bin/sh + +# Test for wildcards in MANDATORY_MANPATH in config file and in MANPATH. +# https://bugzilla.redhat.com/show_bug.cgi?id=677669 + +: ${srcdir=.} +. "$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_pass 'wildcards: -M option: without wildcards: check missing man page' \ + 'diff -u "$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_pass 'wildcards: -M option: with wildcards: check missing man page' \ + 'diff -u "$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_pass 'wildcards: MANPATH: without wildcards: check missing man page' \ + 'diff -u "$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_pass 'wildcards: MANPATH: with wildcards: check missing man page' \ + 'diff -u "$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_pass 'wildcards: MANDATORY_MANPATH: without wildcards: check missing man page' \ + 'diff -u "$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_pass 'wildcards: MANDATORY_MANPATH: with wildcards: check missing man page' \ + 'diff -u "$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" <