diff options
author | xuecai <bluesnow1st@sina.com> | 2019-02-17 18:11:45 +0800 |
---|---|---|
committer | Erik Dubbelboer <erik@dubbelboer.com> | 2019-02-17 10:11:45 +0000 |
commit | ed3793a1e1602989ba50bd20823e8521a4da84af (patch) | |
tree | fda5d2754821cf023d595abd03b4469e94cd095c /args_test.go | |
parent | Remove methods that had been deprecated in 2015 (diff) | |
download | fasthttp-ed3793a1e1602989ba50bd20823e8521a4da84af.tar.gz fasthttp-ed3793a1e1602989ba50bd20823e8521a4da84af.tar.bz2 fasthttp-ed3793a1e1602989ba50bd20823e8521a4da84af.zip |
* add tests for copyto
* add HeaderCopy Test reflect.DeepEqual
Diffstat (limited to 'args_test.go')
-rw-r--r-- | args_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/args_test.go b/args_test.go index db44750..1502414 100644 --- a/args_test.go +++ b/args_test.go @@ -269,6 +269,7 @@ func TestArgsCopyTo(t *testing.T) { testCopyTo(t, &a) a.Set("xxx", "yyy") + a.AddNoValue("ba") testCopyTo(t, &a) a.Del("foo") @@ -284,6 +285,10 @@ func testCopyTo(t *testing.T, a *Args) { var b Args a.CopyTo(&b) + if !reflect.DeepEqual(*a, b) { + t.Fatalf("ArgsCopyTo fail, a: \n%+v\nb: \n%+v\n", *a, b) + } + b.VisitAll(func(k, v []byte) { if _, ok := keys[string(k)]; !ok { t.Fatalf("unexpected key %q after copying from %q", k, a.String()) |