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 /uri_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 'uri_test.go')
-rw-r--r-- | uri_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/uri_test.go b/uri_test.go index dcba56e..7ed05f9 100644 --- a/uri_test.go +++ b/uri_test.go @@ -3,6 +3,7 @@ package fasthttp import ( "bytes" "fmt" + "reflect" "testing" "time" ) @@ -183,6 +184,22 @@ func testURIPathNormalize(t *testing.T, u *URI, requestURI, expectedPath string) } } +func TestURICopyTo(t *testing.T) { + var u URI + var copyU URI + u.CopyTo(©U) + if !reflect.DeepEqual(u, copyU) { + t.Fatalf("URICopyTo fail, u: \n%+v\ncopyu: \n%+v\n", u, copyU) + } + + u.UpdateBytes([]byte("https://google.com/foo?bar=baz&baraz#qqqq")) + u.CopyTo(©U) + if !reflect.DeepEqual(u, copyU) { + t.Fatalf("URICopyTo fail, u: \n%+v\ncopyu: \n%+v\n", u, copyU) + } + +} + func TestURIFullURI(t *testing.T) { var args Args |