Add some tests to the IRC client
This commit is contained in:
parent
ff9cae7794
commit
da8915328d
15 changed files with 3088 additions and 39 deletions
18
irc/conn_test.go
Normal file
18
irc/conn_test.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package irc
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/khlieng/name_pending/Godeps/_workspace/src/github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestWrite(t *testing.T) {
|
||||
c.write("test")
|
||||
assert.Equal(t, "test\r\n", <-conn.hook)
|
||||
c.Write("test")
|
||||
assert.Equal(t, "test\r\n", <-conn.hook)
|
||||
c.writef("test %d", 2)
|
||||
assert.Equal(t, "test 2\r\n", <-conn.hook)
|
||||
c.Writef("test %d", 2)
|
||||
assert.Equal(t, "test 2\r\n", <-conn.hook)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue