Skip to content

Commit

Permalink
Make test case compatible with Go 1.17 (#1299)
Browse files Browse the repository at this point in the history
* Make test case compatible with Go 1.17

* tweak test case to bring coverage back up
  • Loading branch information
jawn-smith committed Dec 5, 2021
1 parent 12b7dfd commit e8d8173
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app_test.go
Expand Up @@ -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) {
Expand Down

0 comments on commit e8d8173

Please sign in to comment.