From 168b23556a8c577d6f78b61bd12544b78d1b9c8b Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sat, 22 Mar 2014 17:10:26 +0100 Subject: [PATCH] Improve TestClose --- protocol/protocol_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/protocol/protocol_test.go b/protocol/protocol_test.go index 50a968ac..d7ea489e 100644 --- a/protocol/protocol_test.go +++ b/protocol/protocol_test.go @@ -174,23 +174,23 @@ func TestClose(t *testing.T) { c0.close(nil) - ok := c0.isClosed() - if !ok { + if !c0.isClosed() { + t.Fatal("Connection should be closed") + } + if !m0.isClosed() { t.Fatal("Connection should be closed") } // None of these should panic, some should return an error - ok = c0.ping() - if ok { + if c0.ping() { t.Error("Ping should not return true") } c0.Index("default", nil) c0.Index("default", nil) - _, err := c0.Request("default", "foo", 0, 0) - if err == nil { + if _, err := c0.Request("default", "foo", 0, 0); err == nil { t.Error("Request should return an error") } }