mirror of
https://github.com/fluffle/goirc
synced 2025-07-01 02:53:53 +00:00
Implement feature request #77: Support IRCv3 capability negotiation during registration
This commit is contained in:
parent
b1565dba18
commit
54099b85a3
5 changed files with 268 additions and 14 deletions
|
@ -2,6 +2,8 @@ package client
|
|||
|
||||
import (
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
@ -203,3 +205,20 @@ func TestClientCommands(t *testing.T) {
|
|||
c.VHost("user", "pass")
|
||||
s.nc.Expect("VHOST user pass")
|
||||
}
|
||||
|
||||
func TestSplitCommand(t *testing.T) {
|
||||
nArgs := 100
|
||||
|
||||
args := make([]string, 0)
|
||||
for i := 0; i < nArgs; i++ {
|
||||
args = append(args, "arg"+strconv.Itoa(i))
|
||||
}
|
||||
|
||||
for maxLen := 1; maxLen <= defaultSplit; maxLen *= 2 {
|
||||
for _, argStr := range splitArgs(args, maxLen) {
|
||||
if len(argStr) > maxLen && len(strings.Split(argStr, " ")) > 1 {
|
||||
t.Errorf("maxLen = %d, but len(cmd) = %d", maxLen, len(argStr))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue