test routine updates
This commit is contained in:
parent
2e8d1a5084
commit
7e9421091a
35
irc_test.go
35
irc_test.go
@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
channel = "#warez"
|
channel = "#testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestJoinChannel(t *testing.T) {
|
func TestJoinChannel(t *testing.T) {
|
||||||
@ -19,21 +19,22 @@ func TestJoinChannel(t *testing.T) {
|
|||||||
go con.Run()
|
go con.Run()
|
||||||
|
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
log.Printf("%d users in channel %s\n", len(con.userList[channel]), channel)
|
t.Logf("%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"])))
|
con.SendPrivmsg(channel, fmt.Sprintf("\x0356FUCK ALL %d OF YOU BITCHES", len(con.userList[channel])))
|
||||||
|
|
||||||
/*
|
i := 0
|
||||||
i := 0
|
for _, v := range con.userList[channel] {
|
||||||
for _, v := range con.userList[channel] {
|
con.SendPrivmsg(channel, fmt.Sprintf("yo %s fuck you", v))
|
||||||
con.SendPrivmsg(channel, fmt.Sprintf("yo %s fuck you", v))
|
if i >= 5 {
|
||||||
if i >= 5 {
|
time.Sleep(1000 * time.Millisecond)
|
||||||
time.Sleep(1000 * time.Millisecond)
|
i = 0
|
||||||
i = 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
*/
|
}
|
||||||
|
|
||||||
|
time.Sleep(1 * time.Second)
|
||||||
|
|
||||||
|
con.SendQuit("go-irc: Test Join Channel")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLusers(t *testing.T) {
|
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)
|
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.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 {
|
} else {
|
||||||
t.Fatal(err.Error())
|
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))
|
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")
|
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.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