diff --git a/pkg/testutils/logger_test.go b/pkg/testutils/logger_test.go index 1293a199422..df416842e22 100644 --- a/pkg/testutils/logger_test.go +++ b/pkg/testutils/logger_test.go @@ -70,22 +70,22 @@ func TestRaceCondition(t *testing.T) { func TestLogMatcher(t *testing.T) { tests := []struct { - occurences int - subStr string - logs []string - expected bool - errMsg string + occurrences int + subStr string + logs []string + expected bool + errMsg string }{ - {occurences: 1, expected: false, errMsg: "subStr '' does not occur 1 time(s) in []"}, - {occurences: 1, subStr: "hi", logs: []string{"hi"}, expected: true}, - {occurences: 3, subStr: "hi", logs: []string{"hi", "hi"}, expected: false, errMsg: "subStr 'hi' does not occur 3 time(s) in [hi hi]"}, - {occurences: 3, subStr: "hi", logs: []string{"hi", "hi", "hi"}, expected: true}, - {occurences: 1, subStr: "hi", logs: []string{"bye", "bye"}, expected: false, errMsg: "subStr 'hi' does not occur 1 time(s) in [bye bye]"}, + {occurrences: 1, expected: false, errMsg: "subStr '' does not occur 1 time(s) in []"}, + {occurrences: 1, subStr: "hi", logs: []string{"hi"}, expected: true}, + {occurrences: 3, subStr: "hi", logs: []string{"hi", "hi"}, expected: false, errMsg: "subStr 'hi' does not occur 3 time(s) in [hi hi]"}, + {occurrences: 3, subStr: "hi", logs: []string{"hi", "hi", "hi"}, expected: true}, + {occurrences: 1, subStr: "hi", logs: []string{"bye", "bye"}, expected: false, errMsg: "subStr 'hi' does not occur 1 time(s) in [bye bye]"}, } for i, tt := range tests { test := tt t.Run(fmt.Sprintf("%v", i), func(t *testing.T) { - match, errMsg := LogMatcher(test.occurences, test.subStr, test.logs) + match, errMsg := LogMatcher(test.occurrences, test.subStr, test.logs) assert.Equal(t, test.expected, match) assert.Equal(t, test.errMsg, errMsg) })