Skip to content

Commit

Permalink
fix: side-effect in test
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Jun 25, 2024
1 parent b6d6194 commit 62ffc1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmdx/printing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func TestPrinting(t *testing.T) {
for _, s := range tc.contained {
assert.Contains(t, out.String(), s, "%s", out.String())
}
notContained := slices.DeleteFunc(allFields, func(s string) bool {
notContained := slices.DeleteFunc(slices.Clone(allFields), func(s string) bool {
return slices.Contains(tc.contained, s)
})
for _, s := range notContained {
Expand Down Expand Up @@ -257,7 +257,7 @@ func TestPrinting(t *testing.T) {
for _, s := range tc.contained {
assert.Contains(t, out.String(), s, "%s", out.String())
}
notContained := slices.DeleteFunc(allFields, func(s string) bool {
notContained := slices.DeleteFunc(slices.Clone(allFields), func(s string) bool {
return slices.Contains(tc.contained, s)
})
for _, s := range notContained {
Expand Down

0 comments on commit 62ffc1d

Please sign in to comment.