1
0
Fork 0
mirror of https://github.com/fluffle/goirc synced 2025-07-05 21:09:24 +00:00

Split handlers up into three groups.

This commit is contained in:
Alex Bramley 2013-09-28 00:15:54 +01:00
parent 12eb9c89eb
commit 144001d109
5 changed files with 44 additions and 15 deletions

View file

@ -87,7 +87,7 @@ func TestClientAndStateTracking(t *testing.T) {
}
// Check that the internal handlers are correctly set up
for k, _ := range intHandlers {
if _, ok := c.handlers.set[strings.ToLower(k)]; !ok {
if _, ok := c.intHandlers.set[strings.ToLower(k)]; !ok {
t.Errorf("Missing internal handler for '%s'.", k)
}
}
@ -95,7 +95,7 @@ func TestClientAndStateTracking(t *testing.T) {
// Now enable the state tracking code and check its handlers
c.EnableStateTracking()
for k, _ := range stHandlers {
if _, ok := c.handlers.set[strings.ToLower(k)]; !ok {
if _, ok := c.intHandlers.set[strings.ToLower(k)]; !ok {
t.Errorf("Missing state handler for '%s'.", k)
}
}
@ -124,7 +124,7 @@ func TestClientAndStateTracking(t *testing.T) {
// Finally, check state tracking handlers were all removed correctly
for k, _ := range stHandlers {
if _, ok := c.handlers.set[strings.ToLower(k)]; ok && k != "NICK" {
if _, ok := c.intHandlers.set[strings.ToLower(k)]; ok && k != "NICK" {
// A bit leaky, because intHandlers adds a NICK handler.
t.Errorf("State handler for '%s' not removed correctly.", k)
}