aboutsummaryrefslogtreecommitdiff
From upstream PR: https://github.com/urfave/cli/pull/1299

From: William Wilson <william.wilson@canonical.com>
Date: Tue, 31 Aug 2021 14:19:17 -0500
Subject: Make test case compatible with Go 1.17

As of Go 1.17, the go flag package will panic if given a syntactically invalid
flag. This causes TestApp_RunAsSubCommandIncorrectUsage to panic and therefore
fail. See https://golang.org/doc/go1.17#flag for more information.

---
diff --git a/app_test.go b/app_test.go
index 7c38f6048..76e211d68 100644
--- a/app_test.go
+++ b/app_test.go
@@ -476,18 +476,18 @@ func TestApp_RunAsSubCommandIncorrectUsage(t *testing.T) {
 	a := App{
 		Name: "cmd",
 		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) {
m> Josselin Poiret 2021-04-24services: Add a service for rasdaemon....* gnu/services/linux.scm (rasdaemon-configuration, rasdaemon-configuration?, rasdaemon-configuration-record?, rasdaemon-service-type): New variables. * doc/guix.texi (Linux Services): Document it. Signed-off-by: Leo Famulari <leo@famulari.name> B. Wilson 2021-02-08gnu: Remove 'file-systems requirement from kernel-module-loader....* gnu/services/linux.scm (kernel-module-loader-shepherd-service): Remove 'file-systems requirement. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> raid5atemyhomework 2021-01-06services: kernel-module-loader: Return a single 'shepherd-service'....* gnu/services/linux.scm (kernel-module-loader-shepherd-service): Return a 'shepherd-service' instead of a list of it. (kernel-module-loader-service-type): Adjust it. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Brice Waegeneire 2020-09-13services: Fix zram-device-service....* gnu/services/linux.scm (<zram-device-configuration>): Fix typo. Tobias Geerinckx-Rice 2020-08-02services: Add zram-device-service....* gnu/services/linux.scm (<zram-device-configuration>): New record. (zram-device-service-type): New variable. * doc/guix.texi (Linux Services): Document it. * tests/services/linux.scm (zram-swap-device-test): New tests. Efraim Flashner 2020-04-12services: kernel-module-loader: Clean up....Suggested by Efraim Flashner <efraim@flashner.co.il>. See <https://lists.gnu.org/archive/html/bug-guix/2020-04/msg00237.html>. * gnu/services/linux.scm (kernel-module-loader-shepherd-service): Remove unneeded 'respawn?' field. Florian Pelz 2020-04-05gnu: Add kernel-module-loader-service....* doc/guix.texi (Linux Services): Add a new subsection and document the new service and its configuration. * gnu/services/linux.scm (kernel-module-loader-service-type): New type. (kernel-module-loader-shepherd-service): New procedure. * gnu/tests/linux-modules.scm (module-loader-program): Procedure removed. (modules-loaded?-program): New procedure. (run-loadable-kernel-modules-test): 'module-loader-program' procedure replaced by the new one. [os]: Use 'kernel-module-loader-service'. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Brice Waegeneire 2020-01-31gnu: Add earlyoom-service-type....* gnu/services/linux.scm: New file. * tests/services/linux.scm: Add test. * Makefile.am (SCM_TESTS): Register test. * doc/guix.texi (Linux Services): Add a new section and document the new service and its configuration. Maxim Cournoyer