Merge commit 'c3fccc0' into v3-porting

This commit is contained in:
2022-11-07 08:35:12 -05:00
4 changed files with 41 additions and 7 deletions

View File

@@ -654,6 +654,7 @@ func TestApp_FlagsFromExtPackage(t *testing.T) {
}()
a := &App{
AllowExtFlags: true,
Flags: []Flag{
&StringFlag{
Name: "carly",
@@ -677,6 +678,28 @@ func TestApp_FlagsFromExtPackage(t *testing.T) {
if someint != 10 {
t.Errorf("Expected 10 got %d for someint", someint)
}
a = &App{
Flags: []Flag{
&StringFlag{
Name: "carly",
Aliases: []string{"c"},
Required: false,
},
&BoolFlag{
Name: "jimbob",
Aliases: []string{"j"},
Required: false,
Value: true,
},
},
}
// this should return an error since epflag shouldnt be registered
err = a.Run([]string{"foo", "-c", "cly", "--epflag", "10"})
if err == nil {
t.Error("Expected error")
}
}
func TestApp_Setup_defaultsReader(t *testing.T) {