From e8d81738896cbec66cff42e384d3d558a96fa26f Mon Sep 17 00:00:00 2001 From: William Wilson Date: Sun, 5 Dec 2021 13:56:34 -0600 Subject: [PATCH] Make test case compatible with Go 1.17 (#1299) * Make test case compatible with Go 1.17 * tweak test case to bring coverage back up --- app_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app_test.go b/app_test.go index 7c38f60..76e211d 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) {