From c5e13b8b12fd4bc03c012cc693f44e9392a3fed9 Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Wed, 24 Aug 2011 13:56:15 +0100 Subject: [PATCH] Make NICK handler test a little more accurate. --- client/handlers_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/handlers_test.go b/client/handlers_test.go index 72a7d30..27e13c7 100644 --- a/client/handlers_test.go +++ b/client/handlers_test.go @@ -83,7 +83,7 @@ func TestNICK(t *testing.T) { } // Create a "known" nick other than ours - c.NewNick("user1", "ident1", "name one", "host1.com") + user1 := c.NewNick("user1", "ident1", "name one", "host1.com") // Call handler with a NICK line changing user1 to somebody c.h_NICK(parseLine(":user1!ident1@host1.com NICK :somebody")) @@ -93,8 +93,8 @@ func TestNICK(t *testing.T) { if c.GetNick("user1") != nil { t.Errorf("Still have a valid Nick for 'user1'.") } - if n := c.GetNick("somebody"); n == nil { - t.Errorf("No Nick for 'somebody' found.") + if n := c.GetNick("somebody"); n != user1 { + t.Errorf("GetNick(somebody) didn't result in correct Nick.") } // Send a NICK line for an unknown nick.