mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-27 06:42:14 -05:00
f161f111e0
* gnu/packages/patches/go-github-com-urfave-cli-fix-tests.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/golang.scm (go-github-com-urfave-cli)[origin]: Apply it. Signed-off-by: Leo Famulari <leo@famulari.name>
28 lines
835 B
Diff
28 lines
835 B
Diff
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) {
|