test routine updates
This commit is contained in:
parent
2e8d1a5084
commit
7e9421091a
21
irc_test.go
21
irc_test.go
@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
channel = "#warez"
|
||||
channel = "#testing"
|
||||
)
|
||||
|
||||
func TestJoinChannel(t *testing.T) {
|
||||
@ -19,12 +19,10 @@ 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))
|
||||
@ -33,7 +31,10 @@ func TestJoinChannel(t *testing.T) {
|
||||
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")
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user