Skip to content

Commit

Permalink
replace test hardcode with defaultSliceFlagSeparator
Browse files Browse the repository at this point in the history
  • Loading branch information
feedmeapples committed Nov 16, 2022
1 parent 0f8707a commit 377947f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3408,13 +3408,14 @@ func TestFlagSplitMultiValues_Disabled(t *testing.T) {
defer func() {
disableSliceFlagSeparator = false
}()

opts := []string{"opt1", "opt2", "opt3,op", "opt4"}
ret := flagSplitMultiValues(strings.Join(opts, ","))
ret := flagSplitMultiValues(strings.Join(opts, defaultSliceFlagSeparator))
if len(ret) != 1 {
t.Fatalf("failed to disable split slice flag, want: 1, but got: %d", len(ret))
}

if ret[0] != strings.Join(opts, ",") {
t.Fatalf("failed to disable split slice flag, want: %s, but got: %s", strings.Join(opts, ","), ret[0])
if ret[0] != strings.Join(opts, defaultSliceFlagSeparator) {
t.Fatalf("failed to disable split slice flag, want: %s, but got: %s", strings.Join(opts, defaultSliceFlagSeparator), ret[0])
}
}

0 comments on commit 377947f

Please sign in to comment.