aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/go-github-com-urfave-cli-fix-tests.patch
blob: 7408d4ec1687c5604864d773b6b6fa45e8f26141 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Backported from upstream PR: https://github.com/urfave/cli/pull/1299
---
diff --git a/app_test.go b/app_test.go
index 33024ff..6b3aaa3 100644
--- a/app_test.go
+++ b/app_test.go
@@ -513,18 +513,18 @@ func TestApp_RunAsSubcommandParseFlags(t *testing.T) {
 func TestApp_RunAsSubCommandIncorrectUsage(t *testing.T) {
 	a := App{
 		Flags: []Flag{
-			StringFlag{Name: "--foo"},
+			StringFlag{Name: "foo"},
 		},
 		Writer: bytes.NewBufferString(""),
 	}
 
 	set := flag.NewFlagSet("", flag.ContinueOnError)
-	_ = set.Parse([]string{"", "---foo"})
+	_ = set.Parse([]string{"", "-bar"})
 	c := &Context{flagSet: set}
 
 	err := a.RunAsSubcommand(c)
 
-	expect(t, err, errors.New("bad flag syntax: ---foo"))
+	expect(t, err.Error(), "flag provided but not defined: -bar")
 }
 
 func TestApp_CommandWithFlagBeforeTerminator(t *testing.T) {