Skip to content

Commit a35cdc2

Browse files
authored
Merge pull request kubernetes#127691 from mmorel-35/testifylint/[email protected]/apimachinery
fix: enable expected-actual rule from testifylint in module `k8s.io/apimachinery`
2 parents 40aea28 + 0006a3c commit a35cdc2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func TestSetNestedStringSlice(t *testing.T) {
178178
assert.NoError(t, err)
179179
assert.Len(t, obj["x"], 3)
180180
assert.Len(t, obj["x"].(map[string]interface{})["z"], 1)
181-
assert.Equal(t, obj["x"].(map[string]interface{})["z"].([]interface{})[0], "bar")
181+
assert.Equal(t, "bar", obj["x"].(map[string]interface{})["z"].([]interface{})[0])
182182
}
183183

184184
func TestSetNestedSlice(t *testing.T) {
@@ -193,7 +193,7 @@ func TestSetNestedSlice(t *testing.T) {
193193
assert.NoError(t, err)
194194
assert.Len(t, obj["x"], 3)
195195
assert.Len(t, obj["x"].(map[string]interface{})["z"], 1)
196-
assert.Equal(t, obj["x"].(map[string]interface{})["z"].([]interface{})[0], "bar")
196+
assert.Equal(t, "bar", obj["x"].(map[string]interface{})["z"].([]interface{})[0])
197197
}
198198

199199
func TestSetNestedStringMap(t *testing.T) {
@@ -208,7 +208,7 @@ func TestSetNestedStringMap(t *testing.T) {
208208
assert.NoError(t, err)
209209
assert.Len(t, obj["x"], 3)
210210
assert.Len(t, obj["x"].(map[string]interface{})["z"], 1)
211-
assert.Equal(t, obj["x"].(map[string]interface{})["z"].(map[string]interface{})["b"], "bar")
211+
assert.Equal(t, "bar", obj["x"].(map[string]interface{})["z"].(map[string]interface{})["b"])
212212
}
213213

214214
func TestSetNestedMap(t *testing.T) {
@@ -223,5 +223,5 @@ func TestSetNestedMap(t *testing.T) {
223223
assert.NoError(t, err)
224224
assert.Len(t, obj["x"], 3)
225225
assert.Len(t, obj["x"].(map[string]interface{})["z"], 1)
226-
assert.Equal(t, obj["x"].(map[string]interface{})["z"].(map[string]interface{})["b"], "bar")
226+
assert.Equal(t, "bar", obj["x"].(map[string]interface{})["z"].(map[string]interface{})["b"])
227227
}

staging/src/k8s.io/apimachinery/pkg/util/managedfields/internal/typeconverter_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ func TestIndexModels(t *testing.T) {
287287
resultNames[k] = *v.TypeRef.NamedType
288288
}
289289

290-
require.Equal(t, resultNames, map[schema.GroupVersionKind]string{
290+
require.Equal(t, map[schema.GroupVersionKind]string{
291291
{
292292
Group: "mygroup",
293293
Version: "v1",
@@ -313,5 +313,5 @@ func TestIndexModels(t *testing.T) {
313313
Version: "v3",
314314
Kind: "MyOtherKind",
315315
}: "def3",
316-
})
316+
}, resultNames)
317317
}

0 commit comments

Comments
 (0)