From cc8e251c90a2f88e396ef6c46b854478178d56cc Mon Sep 17 00:00:00 2001 From: blackbeard420 Date: Wed, 27 Oct 2021 20:09:03 -0400 Subject: [PATCH] reorganized testing a little --- irc_test.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) 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()) }