func (cs *TestClientServer) CheckLines(t *testing.T, expected []string) bool {
	ok := true
	lines := strings.Split(cs.client.String(), "\r\n")
	var line, clientLine string
	for len(expected) > 0 && len(lines) > 0 {
		line, expected = expected[0], expected[1:]
		clientLine, lines = lines[0], lines[1:]
		ok = ok && assert.Equal(t, line, clientLine)
	}
	ok = ok && assert.Equal(t, 0, len(expected), "Not enough lines: %s", strings.Join(expected, ", "))
	ok = ok && assert.Equal(t, 0, len(lines), "Extra non-empty lines: %s", strings.Join(lines, ", "))
	return ok
}
CheckLines will ensure that the client sent all the expected lines
(and nothing more) and return true if they did and false if they
didn't.
package utils
import (
	"bytes"
	"strings"
	"testing"
	"github.com/stretchr/testify/assert"
	irc "gopkg.in/irc.v3"
)
type TestClientServer struct {
	client *bytes.Buffer
	server *bytes.Buffer
}
func NewTestClientServer() *TestClientServer {
	return &TestClientServer{
		client: &bytes.Buffer{},
		server: &bytes.Buffer{},
	}
}
func (cs *TestClientServer) Read(p []byte) (int, error) {
	return cs.server.Read(p)
}
func (cs *TestClientServer) Write(p []byte) (int, error) {
	return cs.client.Write(p)
}
func (cs *TestClientServer) SendServerLines(lines []string) {
	w := irc.NewWriter(cs.server)
	for _, line := range lines {
		w.WriteMessage(irc.MustParseMessage(line))
	}
}