Skip to content

Commit

Permalink
use sets.New
Browse files Browse the repository at this point in the history
  • Loading branch information
lubedacht committed May 3, 2024
1 parent b8533c3 commit 6e6e666
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions scope/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,8 @@ func TestClusterListMachines(t *testing.T) {
buildMachineWithLabel("machine-2", makeLabels(clusterName, nil)),
buildMachineWithLabel("machine-3", makeLabels(clusterName, nil)),
},
searchLabels: client.MatchingLabels{},
expectedNames: sets.Set[string]{
"machine-1": {},
"machine-2": {},
"machine-3": {},
},
searchLabels: client.MatchingLabels{},
expectedNames: sets.New("machine-1", "machine-2", "machine-3"),
}, {
name: "List only machines with specific labels",
initialObjects: []client.Object{
Expand All @@ -209,10 +205,7 @@ func TestClusterListMachines(t *testing.T) {
searchLabels: client.MatchingLabels{
"foo": "bar",
},
expectedNames: sets.Set[string]{
"machine-1": {},
"machine-2": {},
},
expectedNames: sets.New("machine-1", "machine-2"),
}, {
name: "List no machines",
initialObjects: []client.Object{
Expand All @@ -221,7 +214,7 @@ func TestClusterListMachines(t *testing.T) {
buildMachineWithLabel("machine-3", makeLabels(clusterName, map[string]string{"foo": "notbar"})),
},
searchLabels: makeLabels(clusterName, map[string]string{"foo": "bar"}),
expectedNames: sets.Set[string]{},
expectedNames: sets.New[string](),
}}

for _, test := range tests {
Expand Down

0 comments on commit 6e6e666

Please sign in to comment.