From 9f984ee89781f6f5c7b8c69407ae6894927fbebf Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Mon, 9 Mar 2020 19:44:41 +0100 Subject: [PATCH] Reindent final check This included some things in its string, so `fish_indent` would stomp over it. --- tests/checks/function.fish | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/tests/checks/function.fish b/tests/checks/function.fish index 31a65ee2f..45f13dc61 100644 --- a/tests/checks/function.fish +++ b/tests/checks/function.fish @@ -69,18 +69,24 @@ frob function name1 -a arg1 arg2 echo hello end -function -a arg1 arg2 name2 ; end +function -a arg1 arg2 name2 +end #CHECKERR: {{.*}}checks/function.fish (line {{\d+}}): function: Illegal function name '-a' -#CHECKERR: function -a arg1 arg2 name2 ; end +#CHECKERR: function -a arg1 arg2 name2 #CHECKERR: ^ -function name3 --argument-names arg1 arg2 ; echo hello; echo goodbye; end -function --argument-names arg1 arg2 name4 ; end +function name3 --argument-names arg1 arg2 + echo hello + echo goodbye +end +function --argument-names arg1 arg2 name4 +end #CHECKERR: {{.*}}checks/function.fish (line {{\d+}}): function: Illegal function name '--argument-names' -#CHECKERR: function --argument-names arg1 arg2 name4 ; end +#CHECKERR: function --argument-names arg1 arg2 name4 #CHECKERR: ^ -function name5 abc --argument-names def ; end +function name5 abc --argument-names def +end #CHECKERR: {{.*}}checks/function.fish (line {{\d+}}): function: Unexpected positional argument 'abc' -#CHECKERR: function name5 abc --argument-names def ; end +#CHECKERR: function name5 abc --argument-names def #CHECKERR: ^ functions -q name1; and echo "Function name1 found" functions -q name2; or echo "Function name2 not found as expected" @@ -110,12 +116,14 @@ test "$name1[3..-1]" = "$name1a[2..-1]"; and echo "1 = 1a" test "$name3[3..-1]" = "$name3a[2..-1]"; and echo "3 = 3a" #CHECK: 3 = 3a -function test; echo banana; end +function test + echo banana +end #CHECKERR: {{.*}}checks/function.fish (line {{\d+}}): function: The name 'test' is reserved, #CHECKERR: and can not be used as a function name -#CHECKERR: function test; echo banana; end +#CHECKERR: function test #CHECKERR: ^ -functions -q; or echo "False" +functions -q; or echo False #CHECK: False exit 0