Add some tests to the IRC client

This commit is contained in:
Ken-Håvard Lieng 2015-06-10 05:48:54 +02:00
parent ff9cae7794
commit da8915328d
15 changed files with 3088 additions and 39 deletions

18
irc/conn_test.go Normal file
View 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)
}