Skip to content

Commit

Permalink
fix: enable expected-actual rule from testifylint in module `k8s.io/a…
Browse files Browse the repository at this point in the history
…pimachinery`

Signed-off-by: Matthieu MOREL <[email protected]>

Kubernetes-commit: 0006a3cc3753bd64daa49d81cac77763422a90d3
  • Loading branch information
mmorel-35 authored and k8s-publishing-bot committed Sep 27, 2024
1 parent dc03077 commit 6240126
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pkg/apis/meta/v1/unstructured/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func TestSetNestedStringSlice(t *testing.T) {
assert.NoError(t, err)
assert.Len(t, obj["x"], 3)
assert.Len(t, obj["x"].(map[string]interface{})["z"], 1)
assert.Equal(t, obj["x"].(map[string]interface{})["z"].([]interface{})[0], "bar")
assert.Equal(t, "bar", obj["x"].(map[string]interface{})["z"].([]interface{})[0])
}

func TestSetNestedSlice(t *testing.T) {
Expand All @@ -193,7 +193,7 @@ func TestSetNestedSlice(t *testing.T) {
assert.NoError(t, err)
assert.Len(t, obj["x"], 3)
assert.Len(t, obj["x"].(map[string]interface{})["z"], 1)
assert.Equal(t, obj["x"].(map[string]interface{})["z"].([]interface{})[0], "bar")
assert.Equal(t, "bar", obj["x"].(map[string]interface{})["z"].([]interface{})[0])
}

func TestSetNestedStringMap(t *testing.T) {
Expand All @@ -208,7 +208,7 @@ func TestSetNestedStringMap(t *testing.T) {
assert.NoError(t, err)
assert.Len(t, obj["x"], 3)
assert.Len(t, obj["x"].(map[string]interface{})["z"], 1)
assert.Equal(t, obj["x"].(map[string]interface{})["z"].(map[string]interface{})["b"], "bar")
assert.Equal(t, "bar", obj["x"].(map[string]interface{})["z"].(map[string]interface{})["b"])
}

func TestSetNestedMap(t *testing.T) {
Expand All @@ -223,5 +223,5 @@ func TestSetNestedMap(t *testing.T) {
assert.NoError(t, err)
assert.Len(t, obj["x"], 3)
assert.Len(t, obj["x"].(map[string]interface{})["z"], 1)
assert.Equal(t, obj["x"].(map[string]interface{})["z"].(map[string]interface{})["b"], "bar")
assert.Equal(t, "bar", obj["x"].(map[string]interface{})["z"].(map[string]interface{})["b"])
}
4 changes: 2 additions & 2 deletions pkg/util/managedfields/internal/typeconverter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ func TestIndexModels(t *testing.T) {
resultNames[k] = *v.TypeRef.NamedType
}

require.Equal(t, resultNames, map[schema.GroupVersionKind]string{
require.Equal(t, map[schema.GroupVersionKind]string{
{
Group: "mygroup",
Version: "v1",
Expand All @@ -313,5 +313,5 @@ func TestIndexModels(t *testing.T) {
Version: "v3",
Kind: "MyOtherKind",
}: "def3",
})
}, resultNames)
}

0 comments on commit 6240126

Please sign in to comment.