mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-30 22:34:29 +08:00
69f68d31df
`argparse`, `read`, `set`, `status`, `test` and `[` now can't be used as function names anymore. This is because (except for `test` and `[`) there is no way to wrap these properly, so any function called that will be broken anyway. For `test` (and `[`), there is nothing that can be added and there have been confused users who created a function that then broke everything. Fixes #3000.
32 lines
781 B
Plaintext
32 lines
781 B
Plaintext
|
|
####################
|
|
# Test the -V flag
|
|
|
|
####################
|
|
# Testing -V
|
|
|
|
####################
|
|
# Testing -V with changed variables
|
|
fish: function: Illegal function name '-a'
|
|
function -a arg1 arg2 name2 ; end
|
|
^
|
|
fish: function: Illegal function name '--argument-names'
|
|
function --argument-names arg1 arg2 name4 ; end
|
|
^
|
|
fish: function: Unexpected positional argument 'abc'
|
|
function name5 abc --argument-names def ; end
|
|
^
|
|
|
|
####################
|
|
# Verify that functions can be copied. Tests against regression of issue #3601
|
|
|
|
####################
|
|
# Checking that the copied functions are identical other than the name
|
|
|
|
####################
|
|
# Checking reserved names
|
|
fish: function: The name 'test' is reserved,
|
|
and can not be used as a function name
|
|
function test; echo banana; end
|
|
^
|