Skip to content

Commit

Permalink
#109 test cookie split
Browse files Browse the repository at this point in the history
  • Loading branch information
bnfinet committed May 22, 2019
1 parent 06ab191 commit 5930747
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions pkg/cookie/cookie_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package cookie

import (
"reflect"
"testing"
)

func TestSplitCookie(t *testing.T) {
type args struct {
longString string
maxLen int
}
tests := []struct {
name string
args args
want []string
}{
{"small split", args{"AAAbbbCCCdddEEEfffGGGhhhIIIjjj", 3}, []string{"AAA", "bbb", "CCC", "ddd", "EEE", "fff", "GGG", "hhh", "III", "jjj"}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := SplitCookie(tt.args.longString, tt.args.maxLen); !reflect.DeepEqual(got, tt.want) {
t.Errorf("SplitCookie() = %v, want %v", got, tt.want)
}
})
}
}

0 comments on commit 5930747

Please sign in to comment.