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:
parent
2c5b477233
commit
d6cb0bb026
2 changed files with 22 additions and 9 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue