1
0
Fork 0
mirror of https://github.com/fluffle/goirc synced 2025-05-12 18:44:50 +00:00

Make NICK handler test a little more accurate.

This commit is contained in:
Alex Bramley 2011-08-24 13:56:15 +01:00
parent cf8ab830f7
commit c5e13b8b12

View file

@ -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.