diff --git a/irc_test.go b/irc_test.go index 6afbc88..e14061e 100644 --- a/irc_test.go +++ b/irc_test.go @@ -10,14 +10,14 @@ const ( channel = "#warez" ) -func TestSimpleIrc(t *testing.T) { +func TestJoinChannel(t *testing.T) { con := NewConnection("irc.ouch.chat:6667", "irc-go", "irc-go", nil, []string{channel}) go con.Run() - time.Sleep(10 * time.Second) - + time.Sleep(5 * time.Second) log.Printf("%d users in channel %s\n", len(con.userList[channel]), channel) + con.SendQuit("scan complete") //con.SendPrivmsg("#warez", fmt.Sprintf("\x0356 FUCK YALL BITCHES %d", len(con.userList["#warez"]))) @@ -33,6 +33,19 @@ func TestSimpleIrc(t *testing.T) { */ } +func TestLusers(t *testing.T) { + con := NewConnection("irc.ouch.chat:6667", "irc-go", "irc-go", nil, []string{channel}) + + con.NumericCallback = func(from string, i int, args string) { + if i == RPL_LUSERCLIENT { + log.Printf("luser reply: %s\n", args) + con.SendQuit("scan complete") + } + } + + con.Run() +} + func TestParser(t *testing.T) { log.Printf("testing %s\n", t.Name()) }