From c77255aabc38a66d2778e855882869a6b9bf17ff Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Fri, 19 Sep 2025 14:56:34 +0200 Subject: [PATCH] tests: consolidate __fish_print_help overrides --- tests/checks/basic.fish | 16 ++++++++-------- tests/test_functions/__fish_print_help.fish | 5 ++++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/checks/basic.fish b/tests/checks/basic.fish index 5bef45cc8..657b1b658 100644 --- a/tests/checks/basic.fish +++ b/tests/checks/basic.fish @@ -429,18 +429,18 @@ for foo in 1 2 3 end # Check that these error correctly. -# Simplify __fish_print_help, as it's noisy. -function __fish_print_help - echo $argv[2..] -end $dyn_break eval break -#CHECKERR: break: Not inside of loop -#CHECKERR: break: Not inside of loop +#CHECKERR: Error-message: break: Not inside of loop +#CHECKERR: Documentation for break +#CHECKERR: Error-message: break: Not inside of loop +#CHECKERR: Documentation for break $dyn_continue eval continue -#CHECKERR: continue: Not inside of loop -#CHECKERR: continue: Not inside of loop +#CHECKERR: Error-message: continue: Not inside of loop +#CHECKERR: Documentation for continue +#CHECKERR: Error-message: continue: Not inside of loop +#CHECKERR: Documentation for continue # Test implicit cd. This should do nothing. ./ diff --git a/tests/test_functions/__fish_print_help.fish b/tests/test_functions/__fish_print_help.fish index 926644091..0ecc5daab 100644 --- a/tests/test_functions/__fish_print_help.fish +++ b/tests/test_functions/__fish_print_help.fish @@ -1,4 +1,7 @@ function __fish_print_help - echo Documentation for $argv >&2 + if set -q argv[2] + echo Error-message: $argv[2] >&2 + end + echo Documentation for $argv[1] >&2 return 1 end