From 286c60bc9d1b692b650bd0c37a6da635e99f119f Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 17 May 2015 14:17:01 -0700 Subject: Correctly handle mixing named arguments with function name Before this fix, `function -a arg1 name1` would produce a function named 'arg1'. After this fix, it will produce a function named 'name'. See #2068 for more. --- tests/function.in | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/function.in') diff --git a/tests/function.in b/tests/function.in index e533b25b..747bbcec 100644 --- a/tests/function.in +++ b/tests/function.in @@ -30,3 +30,17 @@ set foo 'bad foo' set bar 'bad bar' set baz 'bad baz' frob + +# Test that -a does not mix up the function name with arguments +# See #2068 +function name1 -a arg1 arg2 ; end +function -a arg1 arg2 name2 ; end +function name3 --argument-names arg1 arg2 ; end +function --argument-names arg1 arg2 name4 ; end +for i in (seq 4) + if functions -q name$i + echo "Function name$i found" + else + echo "Function name$i not found, but should have been" + end +end -- cgit v1.2.3