summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorSarah Morgensen <iskarian@mgsn.dev>2021-09-09 17:50:09 -0700
committerLeo Famulari <leo@famulari.name>2021-09-09 21:34:50 -0400
commitf161f111e0692da4103196a351081a6396f3834a (patch)
treef21873d146ac347b460b524b2762288152c70147 /gnu
parent4e1adbc3b0b6694785476f4f01fbd8004fdfb5a3 (diff)
gnu: go-github-com-urfave-cli: Fix tests when building with Go 1.17.
* 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>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/golang.scm3
-rw-r--r--gnu/packages/patches/go-github-com-urfave-cli-fix-tests.patch28
3 files changed, 31 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 7141fcd31e9..3148c9e82fd 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1184,6 +1184,7 @@ dist_patch_DATA = \
1184 %D%/packages/patches/gobject-introspection-cc.patch \ 1184 %D%/packages/patches/gobject-introspection-cc.patch \
1185 %D%/packages/patches/gobject-introspection-girepository.patch \ 1185 %D%/packages/patches/gobject-introspection-girepository.patch \
1186 %D%/packages/patches/go-fix-script-tests.patch \ 1186 %D%/packages/patches/go-fix-script-tests.patch \
1187 %D%/packages/patches/go-github-com-urfave-cli-fix-tests.patch \
1187 %D%/packages/patches/go-skip-gc-test.patch \ 1188 %D%/packages/patches/go-skip-gc-test.patch \
1188 %D%/packages/patches/gpm-glibc-2.26.patch \ 1189 %D%/packages/patches/gpm-glibc-2.26.patch \
1189 %D%/packages/patches/gpodder-disable-updater.patch \ 1190 %D%/packages/patches/gpodder-disable-updater.patch \
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index b08796e22ab..2d0bbdb30d7 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -4976,7 +4976,8 @@ as conversion to and from @command{net.Addr}.")
4976 (file-name (git-file-name name version)) 4976 (file-name (git-file-name name version))
4977 (sha256 4977 (sha256
4978 (base32 4978 (base32
4979 "10mcnvi5qmn00vpyk6si8gjka7p654wr9hac4zc9w5h3ickhvbdc")))) 4979 "10mcnvi5qmn00vpyk6si8gjka7p654wr9hac4zc9w5h3ickhvbdc"))
4980 (patches (search-patches "go-github-com-urfave-cli-fix-tests.patch"))))
4980 (build-system go-build-system) 4981 (build-system go-build-system)
4981 (arguments 4982 (arguments
4982 '(#:import-path "github.com/urfave/cli")) 4983 '(#:import-path "github.com/urfave/cli"))
diff --git a/gnu/packages/patches/go-github-com-urfave-cli-fix-tests.patch b/gnu/packages/patches/go-github-com-urfave-cli-fix-tests.patch
new file mode 100644
index 00000000000..7408d4ec168
--- /dev/null
+++ b/gnu/packages/patches/go-github-com-urfave-cli-fix-tests.patch
@@ -0,0 +1,28 @@
1Backported from upstream PR: https://github.com/urfave/cli/pull/1299
2---
3diff --git a/app_test.go b/app_test.go
4index 33024ff..6b3aaa3 100644
5--- a/app_test.go
6+++ b/app_test.go
7@@ -513,18 +513,18 @@ func TestApp_RunAsSubcommandParseFlags(t *testing.T) {
8 func TestApp_RunAsSubCommandIncorrectUsage(t *testing.T) {
9 a := App{
10 Flags: []Flag{
11- StringFlag{Name: "--foo"},
12+ StringFlag{Name: "foo"},
13 },
14 Writer: bytes.NewBufferString(""),
15 }
16
17 set := flag.NewFlagSet("", flag.ContinueOnError)
18- _ = set.Parse([]string{"", "---foo"})
19+ _ = set.Parse([]string{"", "-bar"})
20 c := &Context{flagSet: set}
21
22 err := a.RunAsSubcommand(c)
23
24- expect(t, err, errors.New("bad flag syntax: ---foo"))
25+ expect(t, err.Error(), "flag provided but not defined: -bar")
26 }
27
28 func TestApp_CommandWithFlagBeforeTerminator(t *testing.T) {