1
0
Fork 0
mirror of https://github.com/fluffle/goirc synced 2025-05-13 02:53:19 +00:00

Test CTCP handler.

This commit is contained in:
Alex Bramley 2011-08-23 11:03:59 +01:00
parent 7d9b8c3099
commit 8fc23d5c17

View file

@ -119,3 +119,25 @@ func TestNICK(t *testing.T) {
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()
}