#! /bin/sh # Test that whatis behaves appropriately when given a path to an executable. : "${srcdir=.}" # shellcheck source-path=SCRIPTDIR . "$srcdir/testlib.sh" : "${MANDB=mandb}" : "${WHATIS=whatis}" init fake_config /usr/share/man /usr/local/man cat >>"$tmpdir/manpath.config" <"$tmpdir/1.exp" <"$tmpdir/1.out" expect_files_equal 'simple name returns all matches' \ "$tmpdir/1.exp" "$tmpdir/1.out" cat >"$tmpdir/2.exp" <"$tmpdir/2.out" expect_files_equal '/usr/bin/test only returns appropriate match' \ "$tmpdir/2.exp" "$tmpdir/2.out" cat >"$tmpdir/3.exp" <"$tmpdir/3.out" expect_files_equal '/usr/local/bin/test only returns appropriate match' \ "$tmpdir/3.exp" "$tmpdir/3.out" finish