From 7e9421091a3a419e1878a968c35359a1272baa6c Mon Sep 17 00:00:00 2001 From: blackbeard420 Date: Thu, 6 Mar 2025 11:38:30 -0500 Subject: [PATCH] test routine updates --- irc_test.go | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/irc_test.go b/irc_test.go index 08cf33c..801909f 100644 --- a/irc_test.go +++ b/irc_test.go @@ -10,7 +10,7 @@ import ( ) const ( - channel = "#warez" + channel = "#testing" ) func TestJoinChannel(t *testing.T) { @@ -19,21 +19,22 @@ func TestJoinChannel(t *testing.T) { go con.Run() time.Sleep(5 * time.Second) - log.Printf("%d users in channel %s\n", len(con.userList[channel]), channel) - con.SendQuit("scan complete") + t.Logf("%d users in channel %s\n", len(con.userList[channel]), channel) - //con.SendPrivmsg("#warez", fmt.Sprintf("\x0356 FUCK YALL BITCHES %d", len(con.userList["#warez"]))) + con.SendPrivmsg(channel, fmt.Sprintf("\x0356FUCK ALL %d OF YOU BITCHES", len(con.userList[channel]))) - /* - i := 0 - for _, v := range con.userList[channel] { - con.SendPrivmsg(channel, fmt.Sprintf("yo %s fuck you", v)) - if i >= 5 { - time.Sleep(1000 * time.Millisecond) - i = 0 - } + i := 0 + for _, v := range con.userList[channel] { + con.SendPrivmsg(channel, fmt.Sprintf("yo %s fuck you", v)) + if i >= 5 { + time.Sleep(1000 * time.Millisecond) + i = 0 } - */ + } + + time.Sleep(1 * time.Second) + + con.SendQuit("go-irc: Test Join Channel") } func TestLusers(t *testing.T) { @@ -51,7 +52,7 @@ func TestLusers(t *testing.T) { fmt.Sscanf(s[1], "There are %d users and %d invisible on %d servers", &users, &invis, &servers) con.SendPrivmsg(channel, fmt.Sprintf("total users on network: %d, invisible %d, servers %d", users, invis, servers)) } - con.SendQuit("scan complete") + con.SendQuit("go-irc: Test luser scan") } } @@ -72,7 +73,7 @@ func TestLusersChannels(t *testing.T) { } else { t.Fatal(err.Error()) } - con.SendQuit("scan complete") + con.SendQuit("go-irc: test luser channels") } } @@ -91,7 +92,9 @@ func TestGetServerInfo(t *testing.T) { con.SendPrivmsg(channel, fmt.Sprintf("EFNet has %d users, %d channels, %d servers, %d invisible", res.Users, res.Channels, res.Servers, res.Invisible)) res = GetServerInfo("irc.us.ircnet.net:6667", "irc-go4240") con.SendPrivmsg(channel, fmt.Sprintf("IRCnet has %d users, %d channels, %d servers, %d invisible", res.Users, res.Channels, res.Servers, res.Invisible)) - con.SendQuit("Scan Completed") + res = GetServerInfo("irc.letspiss.net:6667", "irc-go4240") + con.SendPrivmsg(channel, fmt.Sprintf("pissnet has %d users, %d channels, %d servers, %d invisible", res.Users, res.Channels, res.Servers, res.Invisible)) + con.SendQuit("go-irc: test GetServerInfo") }() } }