mirror of https://github.com/fluffle/goirc
Test CTCP handler.
This commit is contained in:
parent
7d9b8c3099
commit
8fc23d5c17
|
@ -119,3 +119,25 @@ func TestNICK(t *testing.T) {
|
||||||
timer.Stop()
|
timer.Stop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestCTCP(t *testing.T) {
|
||||||
|
m, c := setUp(t)
|
||||||
|
|
||||||
|
// Call handler with CTCP VERSION
|
||||||
|
c.h_CTCP(parseLine(":blah!moo@cows.com PRIVMSG test :\001VERSION\001"))
|
||||||
|
|
||||||
|
// Expect a version reply
|
||||||
|
m.Expect("NOTICE blah :\001VERSION powered by goirc...\001")
|
||||||
|
|
||||||
|
// Call handler with CTCP PING
|
||||||
|
c.h_CTCP(parseLine(":blah!moo@cows.com PRIVMSG test :\001PING 1234567890\001"))
|
||||||
|
|
||||||
|
// Expect a ping reply
|
||||||
|
m.Expect("NOTICE blah :\001PING 1234567890\001")
|
||||||
|
|
||||||
|
// Call handler with CTCP UNKNOWN
|
||||||
|
c.h_CTCP(parseLine(":blah!moo@cows.com PRIVMSG test :\001UNKNOWN ctcp\001"))
|
||||||
|
|
||||||
|
// Expect nothing in reply
|
||||||
|
m.ExpectNothing()
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue