Skip to content

Commit

Permalink
removing expectedOverride in tests as it is not supposed to be changed
Browse files Browse the repository at this point in the history
  • Loading branch information
dortam888 committed Nov 4, 2024
1 parent b561ef9 commit c4b71b2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions plugins/components/conversionlayer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ func TestCreateCommandUsages(t *testing.T) {
strFlag := NewStringFlag("flag", "", SetMandatory())

override := []string{"usage override", "usage override 2", "usage override 3"}
expectedOverride := override

tests := []struct {
name string
Expand Down Expand Up @@ -88,7 +87,7 @@ func TestCreateCommandUsages(t *testing.T) {
UsageOptions: &UsageOptions{Usage: override},
},
stringFlags: map[string]StringFlag{optStrFlag.Name: optStrFlag},
expected: append(expectedOverride,
expected: append(override,
fmt.Sprintf("%s [command options] <%s> <%s>", expectedPrefix, "first argument", "second"),
fmt.Sprintf("%s [command options] --%s=<%s> <%s>", expectedPrefix, optStrFlag.Name, optStrFlag.HelpValue, "first argument"),
),
Expand All @@ -102,7 +101,7 @@ func TestCreateCommandUsages(t *testing.T) {
UsageOptions: &UsageOptions{Usage: override, ReplaceAutoGeneratedUsage: true},
},
stringFlags: map[string]StringFlag{optStrFlag.Name: optStrFlag, strFlag.Name: strFlag},
expected: expectedOverride,
expected: override, //override is not expected to be changed upon using UsageOptions

Check failure on line 104 in plugins/components/conversionlayer_test.go

View workflow job for this annotation

GitHub Actions / Static-Check

commentFormatting: put a space between `//` and comment text (gocritic)
},
}

Expand Down

0 comments on commit c4b71b2

Please sign in to comment.