diff --git a/tests/checks/andandoror.fish b/tests/checks/andandoror.fish index 806315699..c074ba0b8 100644 --- a/tests/checks/andandoror.fish +++ b/tests/checks/andandoror.fish @@ -113,40 +113,28 @@ echo comment after conjunction # --help works builtin and --help >/dev/null -# CHECKERR: fish: and: missing man page -# CHECKERR: Documentation may not be installed. -# CHECKERR: `help and` will show an online version +# CHECKERR: Documentation for and echo $status and --help >/dev/null -# CHECKERR: fish: and: missing man page -# CHECKERR: Documentation may not be installed. -# CHECKERR: `help and` will show an online version +# CHECKERR: Documentation for and echo $status # CHECK: 0 # CHECK: 0 builtin or --help >/dev/null -# CHECKERR: fish: or: missing man page -# CHECKERR: Documentation may not be installed. -# CHECKERR: `help or` will show an online version +# CHECKERR: Documentation for or echo $status or --help >/dev/null -# CHECKERR: fish: or: missing man page -# CHECKERR: Documentation may not be installed. -# CHECKERR: `help or` will show an online version +# CHECKERR: Documentation for or echo $status # CHECK: 0 # CHECK: 0 builtin not --help >/dev/null -# CHECKERR: fish: not: missing man page -# CHECKERR: Documentation may not be installed. -# CHECKERR: `help not` will show an online version +# CHECKERR: Documentation for not echo $status not --help >/dev/null -# CHECKERR: fish: not: missing man page -# CHECKERR: Documentation may not be installed. -# CHECKERR: `help not` will show an online version +# CHECKERR: Documentation for not echo $status # CHECK: 0 # CHECK: 0 diff --git a/tests/checks/builtinbuiltin.fish b/tests/checks/builtinbuiltin.fish index 7c8e7193d..8fac4ac4c 100644 --- a/tests/checks/builtinbuiltin.fish +++ b/tests/checks/builtinbuiltin.fish @@ -10,7 +10,7 @@ builtin -nq string echo $status #CHECK: 2 -builtin -- -q &| grep -q "builtin - run a builtin command\|fish: builtin: missing man page" +builtin -- -q &| grep -q "Documentation for builtin" echo $status #CHECK: 0 diff --git a/tests/checks/expansion.fish b/tests/checks/expansion.fish index 713fc509c..87c3f8758 100644 --- a/tests/checks/expansion.fish +++ b/tests/checks/expansion.fish @@ -342,9 +342,7 @@ echo foo | $pager #CHECKERR: ^~~~~^ "command" -h -#CHECKERR: fish: command: missing man page -#CHECKERR: Documentation may not be installed. -#CHECKERR: `help command` will show an online version +#CHECKERR: Documentation for command echo {~,asdf} # CHECK: /{{.*}} asdf diff --git a/tests/checks/not.fish b/tests/checks/not.fish index 111e434f8..1b47744a2 100644 --- a/tests/checks/not.fish +++ b/tests/checks/not.fish @@ -10,9 +10,7 @@ echo $status # CHECK: 34 ! -h -# CHECKERR: fish: !: missing man page -# CHECKERR: Documentation may not be installed. -# CHECKERR: `help !` will show an online version +# CHECKERR: Documentation for ! function ! echo overridden! $argv diff --git a/tests/checks/print-help.fish b/tests/checks/print-help.fish index 0e0c7e065..b5bf1172d 100644 --- a/tests/checks/print-help.fish +++ b/tests/checks/print-help.fish @@ -11,6 +11,6 @@ echo '.\" Test manpage for and (not real). and \- conditionally execute a command' >$__fish_data_dir/man/man1/and.1 # help should be redirected to grep instead of appearing on STDOUT -builtin and --help | grep -q "and - conditionally execute a command" +builtin and --help 2>| grep -q "Documentation for and" echo $status #CHECK: 0 diff --git a/tests/checks/psub.fish b/tests/checks/psub.fish index a2e8c7d2c..5d5874f5b 100644 --- a/tests/checks/psub.fish +++ b/tests/checks/psub.fish @@ -57,5 +57,5 @@ else end #CHECK: psub directory was deleted -set -l diffs (comm -3 (__fish_print_help psub | psub) (psub -hs banana | psub)) +set -l diffs (comm -3 (__fish_print_help psub 2>| psub) (psub -hs banana 2>| psub)) test -z "$diffs" diff --git a/tests/checks/scoping.fish b/tests/checks/scoping.fish index f2547580a..87d95811a 100644 --- a/tests/checks/scoping.fish +++ b/tests/checks/scoping.fish @@ -241,9 +241,7 @@ echo 7 $status # no passthrough #CHECK: 7 4 false set -h >/dev/null -# CHECKERR: fish: set: missing man page -# CHECKERR: Documentation may not be installed. -# CHECKERR: `help set` will show an online version +# CHECKERR: Documentation for set echo 8 $status # no passthrough #CHECK: 8 0 diff --git a/tests/checks/syntax-error-location.fish b/tests/checks/syntax-error-location.fish index 14d0df8d2..371642b8f 100644 --- a/tests/checks/syntax-error-location.fish +++ b/tests/checks/syntax-error-location.fish @@ -86,9 +86,7 @@ $fish -c 'begin --notanoption; end' # CHECKERR: ^~~~~~~~~~~~^ $fish -c 'begin --help' -# CHECKERR: fish: begin: missing man page -# CHECKERR: Documentation may not be installed. -# CHECKERR: `help begin` will show an online version +# CHECKERR: Documentation for begin $fish -c 'echo (for status in foo; end)' # CHECKERR: fish: for: status: cannot overwrite read-only variable diff --git a/tests/checks/time.fish b/tests/checks/time.fish index ac78e05bc..e87d246bd 100644 --- a/tests/checks/time.fish +++ b/tests/checks/time.fish @@ -46,13 +46,9 @@ not time a=b true # Currently illegal syntax. Same in zsh. POSIX shells call the external command "time" here. a=b time true -#CHECKERR: fish: time: missing man page -#CHECKERR: Documentation may not be installed. -#CHECKERR: `help time` will show an online version +#CHECKERR: Documentation for time not a=b time true -#CHECKERR: fish: time: missing man page -#CHECKERR: Documentation may not be installed. -#CHECKERR: `help time` will show an online version +#CHECKERR: Documentation for time $fish -c 'time true&' #CHECKERR: fish: {{.*}} diff --git a/tests/test_functions/__fish_print_help.fish b/tests/test_functions/__fish_print_help.fish new file mode 100644 index 000000000..926644091 --- /dev/null +++ b/tests/test_functions/__fish_print_help.fish @@ -0,0 +1,4 @@ +function __fish_print_help + echo Documentation for $argv >&2 + return 1 +end