Skip to content

Commit

Permalink
Fix spelling in logger_test.go (jaegertracing#1390)
Browse files Browse the repository at this point in the history
Signed-off-by: zhoulin xie <[email protected]>
  • Loading branch information
JoeWrightss authored and Annanay committed Mar 1, 2019
1 parent 78696af commit d22f364
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pkg/testutils/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down

0 comments on commit d22f364

Please sign in to comment.