aboutsummaryrefslogtreecommitdiff
path: root/uri_test.go
diff options
context:
space:
mode:
authorGravatar Aliaksandr Valialkin <valyala@gmail.com> 2016-02-19 20:17:37 +0200
committerGravatar Aliaksandr Valialkin <valyala@gmail.com> 2016-02-19 20:17:37 +0200
commit58e4dea85db1b01e95b02e105b2a0e953c52694a (patch)
tree4343ca86ceeb660a37d9d7fc7f01aff1679e5b6c /uri_test.go
parentAllow updating request's RequestURI and Host header via Request.URI() (diff)
downloadfasthttp-58e4dea85db1b01e95b02e105b2a0e953c52694a.tar.gz
fasthttp-58e4dea85db1b01e95b02e105b2a0e953c52694a.tar.bz2
fasthttp-58e4dea85db1b01e95b02e105b2a0e953c52694a.zip
Properly copy query arguments in URI.CopyTo
Diffstat (limited to 'uri_test.go')
-rw-r--r--uri_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/uri_test.go b/uri_test.go
index 5d489f5..3e519dc 100644
--- a/uri_test.go
+++ b/uri_test.go
@@ -7,6 +7,20 @@ import (
"time"
)
+func TestURICopyToQueryArgs(t *testing.T) {
+ var u URI
+ a := u.QueryArgs()
+ a.Set("foo", "bar")
+
+ var u1 URI
+ u.CopyTo(&u1)
+ a1 := u1.QueryArgs()
+
+ if string(a1.Peek("foo")) != "bar" {
+ t.Fatalf("unexpected query args value %q. Expecting %q", a1.Peek("foo"), "bar")
+ }
+}
+
func TestURIAcquireReleaseSequential(t *testing.T) {
testURIAcquireRelease(t)
}