@@ -3269,6 +3269,26 @@ func TestZeroValueMutexFlag(t *testing.T) {
32693269 assert .NoError (t , fl .check (& Command {}))
32703270}
32713271
3272+ func TestMutexFlagCategory (t * testing.T ) {
3273+ cmd := buildMinimalTestCommand ()
3274+ cmd .Category = "TestCmd"
3275+ cmd .MutuallyExclusiveFlags = []MutuallyExclusiveFlags {
3276+ {
3277+ Flags : [][]Flag {
3278+ {
3279+ & StringFlag {Name : "foo" , Category : "Group1" },
3280+ & IntFlag {Name : "bar" , Category : "Group1" },
3281+ },
3282+ {
3283+ & StringFlag {Name : "baz" , Category : "Group2" },
3284+ },
3285+ },
3286+ },
3287+ }
3288+
3289+ assert .NoError (t , cmd .Run (buildTestContext (t ), []string {"" , "--foo" , "value" }))
3290+ }
3291+
32723292func TestExtFlag (t * testing.T ) {
32733293 var iv intValue [int64 ]
32743294 var ipv int64
@@ -3467,3 +3487,15 @@ func TestGenericValue(t *testing.T) {
34673487 assert .Nil (t , g .Get ())
34683488 assert .Empty (t , g .String ())
34693489}
3490+
3491+ func TestEndValue (t * testing.T ) {
3492+ cmd := buildMinimalTestCommand ()
3493+ cmd .UseShortOptionHandling = true
3494+ cmd .Flags = []Flag {
3495+ & IntFlag {Name : "debug" , Aliases : []string {"d" }},
3496+ & IntFlag {Name : "count" , Aliases : []string {"c" }},
3497+ }
3498+
3499+ assert .Error (t , cmd .Run (buildTestContext (t ), []string {"foo" , "-cd=" }))
3500+ assert .Error (t , cmd .Run (buildTestContext (t ), []string {"foo" , "-cd=s" }))
3501+ }
0 commit comments