Avoid testing log output

This commit is contained in:
Ian Kent 2014-11-23 03:51:24 +00:00
parent 33d706d401
commit 86a0d413ad

View file

@ -27,11 +27,13 @@ func TestProtocol(t *testing.T) {
handlerCalled := false handlerCalled := false
proto.LogHandler = func(message string, args ...interface{}) { proto.LogHandler = func(message string, args ...interface{}) {
handlerCalled = true handlerCalled = true
So(message, ShouldEqual, "[PROTO: %s] Started session, switching to ESTABLISH state") So(message, ShouldEqual, "[PROTO: %s] Test message %s %s")
So(len(args), ShouldEqual, 1) So(len(args), ShouldEqual, 3)
So(args[0], ShouldEqual, "INVALID") So(args[0], ShouldEqual, "INVALID")
So(args[1], ShouldEqual, "test arg 1")
So(args[2], ShouldEqual, "test arg 2")
} }
proto.Start() proto.logf("Test message %s %s", "test arg 1", "test arg 2")
So(handlerCalled, ShouldBeTrue) So(handlerCalled, ShouldBeTrue)
}) })