tests: consolidate __fish_print_help overrides

This commit is contained in:
Johannes Altmanninger
2025-09-19 14:56:34 +02:00
parent 0063992195
commit c77255aabc
2 changed files with 12 additions and 9 deletions

View File

@@ -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.
./

View File

@@ -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