[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/04: gnu: go-github-com-urfave-cli: Fix tests when building with Go 1.
From: |
guix-commits |
Subject: |
03/04: gnu: go-github-com-urfave-cli: Fix tests when building with Go 1.17. |
Date: |
Thu, 9 Sep 2021 21:35:55 -0400 (EDT) |
lfam pushed a commit to branch master
in repository guix.
commit f161f111e0692da4103196a351081a6396f3834a
Author: Sarah Morgensen <iskarian@mgsn.dev>
AuthorDate: Thu Sep 9 17:50:09 2021 -0700
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>
---
gnu/local.mk | 1 +
gnu/packages/golang.scm | 3 ++-
.../go-github-com-urfave-cli-fix-tests.patch | 28 ++++++++++++++++++++++
3 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index 7141fcd..3148c9e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1184,6 +1184,7 @@ dist_patch_DATA =
\
%D%/packages/patches/gobject-introspection-cc.patch \
%D%/packages/patches/gobject-introspection-girepository.patch \
%D%/packages/patches/go-fix-script-tests.patch \
+ %D%/packages/patches/go-github-com-urfave-cli-fix-tests.patch \
%D%/packages/patches/go-skip-gc-test.patch \
%D%/packages/patches/gpm-glibc-2.26.patch \
%D%/packages/patches/gpodder-disable-updater.patch \
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index b08796e..2d0bbdb 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -4976,7 +4976,8 @@ as conversion to and from @command{net.Addr}.")
(file-name (git-file-name name version))
(sha256
(base32
- "10mcnvi5qmn00vpyk6si8gjka7p654wr9hac4zc9w5h3ickhvbdc"))))
+ "10mcnvi5qmn00vpyk6si8gjka7p654wr9hac4zc9w5h3ickhvbdc"))
+ (patches (search-patches "go-github-com-urfave-cli-fix-tests.patch"))))
(build-system go-build-system)
(arguments
'(#: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 0000000..7408d4e
--- /dev/null
+++ b/gnu/packages/patches/go-github-com-urfave-cli-fix-tests.patch
@@ -0,0 +1,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) {