Descriptiontesting/checkers/log: Clearer failures
When Andrew changed the LogMatches function to only assert the
existence of messages he accidentally removed the work I had done to
give clearer messages when there was a problem.
This changes some types around and updates the params values like we
did before. So that instead of getting:
log_test.go:47:
c.Check(log, jc.LogMatches, []string{"foo bar", "a2345"})
... obtained []loggo.TestLogValues = []loggo.TestLogValues{loggo.TestLogValues{Level:0x3, Module:"", Filename:"", Line:0, Timestamp:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}, Message:"foo bar"}, loggo.TestLogValues{Level:0x3, Module:"", Filename:"", Line:0, Timestamp:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}, Message:"12345"}}
... expected []string = []string{"foo bar", "a2345"}
We now get:
log_test.go:47:
c.Check(log, jc.LogMatches, []string{"foo bar", "a2345"})
... obtained checkers.SimpleMessages = SimpleMessages{
INFO 12345
}
... expected checkers.SimpleMessages = SimpleMessages{
UNSPECIFIED a2345
}
https://code.launchpad.net/~jameinel/juju-core/log-matcher-cleanup/+merge/193022
(do not edit description out of merge proposal)
Patch Set 1 #
MessagesTotal messages: 2
|