1
0
Fork 0
mirror of https://github.com/fluffle/goirc synced 2025-05-15 03:53:27 +00:00

Fix comments and my poor code-reading skills. Damn you StalkR :-)

This commit is contained in:
Alex Bramley 2013-03-10 12:17:16 +00:00
parent 2c5b477233
commit d6cb0bb026
2 changed files with 22 additions and 9 deletions

View file

@ -2,6 +2,25 @@ package client
import "testing"
func TestCutNewLines(t *testing.T) {
tests := []struct{ in, out string }{
{"", ""},
{"foo bar", "foo bar"},
{"foo bar\rbaz", "foo bar"},
{"foo bar\nbaz", "foo bar"},
{"blorp\r\n\r\nbloop", "blorp"},
{"\n\rblaap", ""},
{"\r\n", ""},
{"boo\\r\\n\\n\r", "boo\\r\\n\\n"},
}
for i, test := range tests {
out := cutNewLines(test.in)
if test.out != out {
t.Errorf("test %d: expected '%s', got '%s'", i, test.out, out)
}
}
}
func TestClientCommands(t *testing.T) {
c, s := setUp(t)
defer s.tearDown()