@@ -43,14 +43,20 @@ func (s *ServerSuite) TestTailFile(c *C) {
43
43
c .Check (handler .LastLogParts ["hostname" ], Equals , "hostname" )
44
44
c .Check (handler .LastLogParts ["tag" ], Equals , "tag" )
45
45
c .Check (handler .LastLogParts ["content" ], Equals , "content" )
46
+ c .Check (handler .LastMessageLength , Equals , int64 (len (exampleSyslog )))
47
+ c .Check (handler .LastError , IsNil )
46
48
}
47
49
48
50
type HandlerMock struct {
49
51
LastLogParts syslogparser.LogParts
52
+ LastMessageLength int64
53
+ LastError error
50
54
}
51
55
52
56
func (self * HandlerMock ) Handle (logParts syslogparser.LogParts , msgLen int64 , err error ) {
53
57
self .LastLogParts = logParts
58
+ self .LastMessageLength = msgLen
59
+ self .LastError = err
54
60
}
55
61
56
62
type ConnMock struct {
@@ -127,4 +133,6 @@ func (s *ServerSuite) TestTcpTimeout(c *C) {
127
133
server .Wait ()
128
134
c .Check (con .isReadDeadline , Equals , true )
129
135
c .Check (handler .LastLogParts , IsNil )
136
+ c .Check (handler .LastMessageLength , Equals , int64 (0 ))
137
+ c .Check (handler .LastError , IsNil )
130
138
}
0 commit comments