mirror of https://github.com/fluffle/goirc
Make NICK handler test a little more accurate.
This commit is contained in:
parent
cf8ab830f7
commit
c5e13b8b12
|
@ -83,7 +83,7 @@ func TestNICK(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a "known" nick other than ours
|
// 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
|
// Call handler with a NICK line changing user1 to somebody
|
||||||
c.h_NICK(parseLine(":user1!ident1@host1.com NICK :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 {
|
if c.GetNick("user1") != nil {
|
||||||
t.Errorf("Still have a valid Nick for 'user1'.")
|
t.Errorf("Still have a valid Nick for 'user1'.")
|
||||||
}
|
}
|
||||||
if n := c.GetNick("somebody"); n == nil {
|
if n := c.GetNick("somebody"); n != user1 {
|
||||||
t.Errorf("No Nick for 'somebody' found.")
|
t.Errorf("GetNick(somebody) didn't result in correct Nick.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send a NICK line for an unknown nick.
|
// Send a NICK line for an unknown nick.
|
||||||
|
|
Loading…
Reference in New Issue