Skip to content

Commit

Permalink
Merge from main
Browse files Browse the repository at this point in the history
  • Loading branch information
dearchap committed Sep 10, 2022
1 parent 0c7dcf7 commit f6b4ee0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion altsrc/flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (ris *racyInputSource) isSet(name string) bool {
func TestGenericApplyInputSourceValue_Alias(t *testing.T) {
v := &Parser{"abc", "def"}
tis := testApplyInputSource{
Flag: NewGenericFlag(&cli.GenericFlag{Name: "test", Aliases: []string{"test_alias"}, Value: &Parser{}}),
Flag: NewGenericFlag(&cli.GenericFlag{Name: "test", Aliases: []string{"test_alias"}, Value: &Parser{}}),
FlagName: "test_alias",
MapValue: v,
}
Expand Down
18 changes: 9 additions & 9 deletions flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2693,55 +2693,55 @@ func TestFlagDefaultValue(t *testing.T) {
name: "stringSlice",
flag: &StringSliceFlag{Name: "flag", Value: NewStringSlice("default1", "default2")},
toParse: []string{"--flag", "parsed"},
expect: `--flag value [ --flag value ] (default: "default1", "default2")`,
expect: `--flag value [ --flag value ] (default: "default1", "default2")`,
},
{
name: "float64Slice",
flag: &Float64SliceFlag{Name: "flag", Value: NewFloat64Slice(1.1, 2.2)},
toParse: []string{"--flag", "13.3"},
expect: `--flag value [ --flag value ] (default: 1.1, 2.2)`,
expect: `--flag value [ --flag value ] (default: 1.1, 2.2)`,
},
{
name: "int64Slice",
flag: &Int64SliceFlag{Name: "flag", Value: NewInt64Slice(1, 2)},
toParse: []string{"--flag", "13"},
expect: `--flag value [ --flag value ] (default: 1, 2)`,
expect: `--flag value [ --flag value ] (default: 1, 2)`,
},
{
name: "intSlice",
flag: &IntSliceFlag{Name: "flag", Value: NewIntSlice(1, 2)},
toParse: []string{"--flag", "13"},
expect: `--flag value [ --flag value ] (default: 1, 2)`,
expect: `--flag value [ --flag value ] (default: 1, 2)`,
},
{
name: "uint64Slice",
flag: &Uint64SliceFlag{Name: "flag", Value: NewUint64Slice(1, 2)},
toParse: []string{"--flag", "13"},
expect: `--flag value [ --flag value ] (default: 1, 2)`,
expect: `--flag value [ --flag value ] (default: 1, 2)`,
},
{
name: "uintSlice",
flag: &UintSliceFlag{Name: "flag", Value: NewUintSlice(1, 2)},
toParse: []string{"--flag", "13"},
expect: `--flag value [ --flag value ] (default: 1, 2)`,
expect: `--flag value [ --flag value ] (default: 1, 2)`,
},
{
name: "string",
flag: &StringFlag{Name: "flag", Value: "default"},
toParse: []string{"--flag", "parsed"},
expect: `--flag value (default: "default")`,
expect: `--flag value (default: "default")`,
},
{
name: "bool",
flag: &BoolFlag{Name: "flag", Value: true},
toParse: []string{"--flag", "false"},
expect: `--flag (default: true)`,
expect: `--flag (default: true)`,
},
{
name: "uint64",
flag: &Uint64Flag{Name: "flag", Value: 1},
toParse: []string{"--flag", "13"},
expect: `--flag value (default: 1)`,
expect: `--flag value (default: 1)`,
},
}
for i, v := range cases {
Expand Down

0 comments on commit f6b4ee0

Please sign in to comment.