This commit is contained in:
parent
8bbf21bfbb
commit
d9a617066f
10
.drone.yml
Normal file
10
.drone.yml
Normal file
@ -0,0 +1,10 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: test
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
image: golang
|
||||
commands:
|
||||
- go test -v
|
||||
- go build
|
24
irc_test.go
24
irc_test.go
@ -1,24 +1,36 @@
|
||||
package irc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
channel = "#warez"
|
||||
)
|
||||
|
||||
func TestSimpleIrc(t *testing.T) {
|
||||
con := NewConnection("thc420.xyz:6667", "irc-go", "irc-go", nil, []string{"#freedom", "#test"})
|
||||
con := NewConnection("irc.ouch.chat:6667", "irc-go", "irc-go", nil, []string{channel})
|
||||
|
||||
go con.Run()
|
||||
|
||||
time.Sleep(10 * time.Second)
|
||||
|
||||
con.SendPrivmsg("#freedom", "\x0356 FUCK YALL BITCHES")
|
||||
log.Printf("%d users in channel %s\n", len(con.userList[channel]), channel)
|
||||
|
||||
for _, v := range con.userList["#freedom"] {
|
||||
con.SendPrivmsg("#freedom", fmt.Sprintf("yo %s fuck you", v))
|
||||
}
|
||||
//con.SendPrivmsg("#warez", fmt.Sprintf("\x0356 FUCK YALL BITCHES %d", len(con.userList["#warez"])))
|
||||
|
||||
/*
|
||||
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
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
func TestParser(t *testing.T) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user