replace zxq.co/ripple/hanayo

This commit is contained in:
Alicia
2019-02-23 13:29:15 +00:00
commit c3d206c173
5871 changed files with 1353715 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
package fasthttp
import (
"testing"
)
func BenchmarkCookieParseMin(b *testing.B) {
var c Cookie
s := []byte("xxx=yyy")
for i := 0; i < b.N; i++ {
if err := c.ParseBytes(s); err != nil {
b.Fatalf("unexpected error when parsing cookies: %s", err)
}
}
}
func BenchmarkCookieParseNoExpires(b *testing.B) {
var c Cookie
s := []byte("xxx=yyy; domain=foobar.com; path=/a/b")
for i := 0; i < b.N; i++ {
if err := c.ParseBytes(s); err != nil {
b.Fatalf("unexpected error when parsing cookies: %s", err)
}
}
}
func BenchmarkCookieParseFull(b *testing.B) {
var c Cookie
s := []byte("xxx=yyy; expires=Tue, 10 Nov 2009 23:00:00 GMT; domain=foobar.com; path=/a/b")
for i := 0; i < b.N; i++ {
if err := c.ParseBytes(s); err != nil {
b.Fatalf("unexpected error when parsing cookies: %s", err)
}
}
}