Commit ea6e8436 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #47206 from gyliu513/typo

Automatic merge from submit-queue Follow up for https://github.com/kubernetes/kubernetes/pull/47003 **What this PR does / why we need it**: This is addressing left comments for https://github.com/kubernetes/kubernetes/pull/47003#discussion_r120888982 /cc @aveshagarwal **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note ```
parents 4ae3b032 159fa86d
......@@ -21,7 +21,7 @@ import (
"fmt"
)
// MessagesgCountMap contains occurance for each error message.
// MessageCountMap contains occurance for each error message.
type MessageCountMap map[string]int
// Aggregate represents an object that contains multiple errors, but does not
......
......@@ -266,7 +266,7 @@ func TestFlatten(t *testing.T) {
func TestCreateAggregateFromMessageCountMap(t *testing.T) {
testCases := []struct {
name string
mcp MessageCountMap
mcm MessageCountMap
expected Aggregate
}{
{
......@@ -279,6 +279,11 @@ func TestCreateAggregateFromMessageCountMap(t *testing.T) {
MessageCountMap{"abc": 2, "ghi": 1},
aggregate{fmt.Errorf("abc (repeated 2 times)"), fmt.Errorf("ghi")},
},
{
"input has multiple messages",
MessageCountMap{"ghi": 1, "abc": 2},
aggregate{fmt.Errorf("abc (repeated 2 times)"), fmt.Errorf("ghi")},
},
}
var expected, agg []error
......@@ -288,8 +293,8 @@ func TestCreateAggregateFromMessageCountMap(t *testing.T) {
expected = testCase.expected.Errors()
sort.Slice(expected, func(i, j int) bool { return expected[i].Error() < expected[j].Error() })
}
if testCase.mcp != nil {
agg = CreateAggregateFromMessageCountMap(testCase.mcp).Errors()
if testCase.mcm != nil {
agg = CreateAggregateFromMessageCountMap(testCase.mcm).Errors()
sort.Slice(agg, func(i, j int) bool { return agg[i].Error() < agg[j].Error() })
}
if !reflect.DeepEqual(expected, agg) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment