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
```
pull/6/head
Kubernetes Submit Queue 2017-07-04 00:25:22 -07:00 committed by GitHub
commit ea6e84365e
2 changed files with 9 additions and 4 deletions

View File

@ -21,7 +21,7 @@ import (
"fmt" "fmt"
) )
// MessagesgCountMap contains occurance for each error message. // MessageCountMap contains occurance for each error message.
type MessageCountMap map[string]int type MessageCountMap map[string]int
// Aggregate represents an object that contains multiple errors, but does not // Aggregate represents an object that contains multiple errors, but does not

View File

@ -266,7 +266,7 @@ func TestFlatten(t *testing.T) {
func TestCreateAggregateFromMessageCountMap(t *testing.T) { func TestCreateAggregateFromMessageCountMap(t *testing.T) {
testCases := []struct { testCases := []struct {
name string name string
mcp MessageCountMap mcm MessageCountMap
expected Aggregate expected Aggregate
}{ }{
{ {
@ -279,6 +279,11 @@ func TestCreateAggregateFromMessageCountMap(t *testing.T) {
MessageCountMap{"abc": 2, "ghi": 1}, MessageCountMap{"abc": 2, "ghi": 1},
aggregate{fmt.Errorf("abc (repeated 2 times)"), fmt.Errorf("ghi")}, 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 var expected, agg []error
@ -288,8 +293,8 @@ func TestCreateAggregateFromMessageCountMap(t *testing.T) {
expected = testCase.expected.Errors() expected = testCase.expected.Errors()
sort.Slice(expected, func(i, j int) bool { return expected[i].Error() < expected[j].Error() }) sort.Slice(expected, func(i, j int) bool { return expected[i].Error() < expected[j].Error() })
} }
if testCase.mcp != nil { if testCase.mcm != nil {
agg = CreateAggregateFromMessageCountMap(testCase.mcp).Errors() agg = CreateAggregateFromMessageCountMap(testCase.mcm).Errors()
sort.Slice(agg, func(i, j int) bool { return agg[i].Error() < agg[j].Error() }) sort.Slice(agg, func(i, j int) bool { return agg[i].Error() < agg[j].Error() })
} }
if !reflect.DeepEqual(expected, agg) { if !reflect.DeepEqual(expected, agg) {