Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
802c0d3c99 |
@@ -148,30 +148,30 @@ func TestRelayLineBreaks(t *testing.T) {
|
|||||||
|
|
||||||
env := newTestEnv(t)
|
env := newTestEnv(t)
|
||||||
|
|
||||||
bob := env.dial(t)
|
alice := env.dial(t)
|
||||||
bob.register("bob")
|
alice.register("alice")
|
||||||
|
|
||||||
env.queueMessage(t, "bob", "PRIVMSG", "carol", "bob", []string{
|
env.queueMessage(t, "alice", "PRIVMSG", "carol", "alice", []string{
|
||||||
"one\r\n:admin!a@b PRIVMSG bob :hi",
|
"one\r\n:admin!a@b PRIVMSG alice :hi",
|
||||||
"two\n:admin!a@b NOTICE bob :hi\x00",
|
"two\n:admin!a@b NOTICE alice :hi\x00",
|
||||||
})
|
})
|
||||||
env.queueMessage(t, "bob", "MODE", "op", "#breaks",
|
env.queueMessage(t, "alice", "MODE", "op", "#breaks",
|
||||||
[]string{"+k", "key\r\nERROR :Closing link"})
|
[]string{"+k", "key\r\nERROR :Closing link"})
|
||||||
env.queueMessage(t, "bob", "MODE", "op", "#breaks",
|
env.queueMessage(t, "alice", "MODE", "op", "#breaks",
|
||||||
[]string{"+b", "*!*@*\r\n:admin!a@b KICK #breaks bob"})
|
[]string{"+b", "*!*@*\r\n:admin!a@b KICK #breaks alice"})
|
||||||
env.queueMessage(t, "bob", "PRIVMSG", "carol", "bob",
|
env.queueMessage(t, "alice", "PRIVMSG", "carol", "alice",
|
||||||
[]string{"the end"})
|
[]string{"the end"})
|
||||||
|
|
||||||
lines := bob.readUntil(func(l string) bool {
|
lines := alice.readUntil(func(l string) bool {
|
||||||
return strings.HasSuffix(l, " :the end")
|
return strings.HasSuffix(l, " :the end")
|
||||||
})
|
})
|
||||||
|
|
||||||
want := []string{
|
want := []string{
|
||||||
":carol!carol@* PRIVMSG bob :one:admin!a@b PRIVMSG bob :hi",
|
":carol!carol@* PRIVMSG alice :one:admin!a@b PRIVMSG alice :hi",
|
||||||
":carol!carol@* PRIVMSG bob :two:admin!a@b NOTICE bob :hi",
|
":carol!carol@* PRIVMSG alice :two:admin!a@b NOTICE alice :hi",
|
||||||
":op!op@* MODE #breaks +k :keyERROR :Closing link",
|
":op!op@* MODE #breaks +k :keyERROR :Closing link",
|
||||||
":op!op@* MODE #breaks +b :*!*@*:admin!a@b KICK #breaks bob",
|
":op!op@* MODE #breaks +b :*!*@*:admin!a@b KICK #breaks alice",
|
||||||
":carol!carol@* PRIVMSG bob :the end",
|
":carol!carol@* PRIVMSG alice :the end",
|
||||||
}
|
}
|
||||||
|
|
||||||
got := lines[max(0, len(lines)-len(want)):]
|
got := lines[max(0, len(lines)-len(want)):]
|
||||||
|
|||||||
Reference in New Issue
Block a user