gnu: r-biocviews: Update to 1.64.1.
[jackhill/guix/guix.git] / gnu / packages / patches / go-github-com-urfave-cli-v2-fix-tests.patch
CommitLineData
63cc4dd5
SM
1From upstream PR: https://github.com/urfave/cli/pull/1299
2
3From: William Wilson <william.wilson@canonical.com>
4Date: Tue, 31 Aug 2021 14:19:17 -0500
5Subject: Make test case compatible with Go 1.17
6
7As of Go 1.17, the go flag package will panic if given a syntactically invalid
8flag. This causes TestApp_RunAsSubCommandIncorrectUsage to panic and therefore
9fail. See https://golang.org/doc/go1.17#flag for more information.
10
11---
12diff --git a/app_test.go b/app_test.go
13index 7c38f6048..76e211d68 100644
14--- a/app_test.go
15+++ b/app_test.go
16@@ -476,18 +476,18 @@ func TestApp_RunAsSubCommandIncorrectUsage(t *testing.T) {
17 a := App{
18 Name: "cmd",
19 Flags: []Flag{
20- &StringFlag{Name: "--foo"},
21+ &StringFlag{Name: "foo"},
22 },
23 Writer: bytes.NewBufferString(""),
24 }
25
26 set := flag.NewFlagSet("", flag.ContinueOnError)
27- _ = set.Parse([]string{"", "---foo"})
28+ _ = set.Parse([]string{"", "-bar"})
29 c := &Context{flagSet: set}
30
31 err := a.RunAsSubcommand(c)
32
33- expect(t, err, errors.New("bad flag syntax: ---foo"))
34+ expect(t, err.Error(), "flag provided but not defined: -bar")
35 }
36
37 func TestApp_CommandWithFlagBeforeTerminator(t *testing.T) {