diff options
author | Sujit Baniya <itsursujit@gmail.com> | 2021-07-01 14:42:21 +0545 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-01 10:57:21 +0200 |
commit | d0df1e1dde9159848f2153989461e0a3e81f2b40 (patch) | |
tree | 7dc4c8c3ed9b222acfa0df93a04cc5bc439bb8b9 /server_test.go | |
parent | Increase TestHostClientMaxConnWaitTimeoutSuccess timeout (diff) | |
download | fasthttp-d0df1e1dde9159848f2153989461e0a3e81f2b40.tar.gz fasthttp-d0df1e1dde9159848f2153989461e0a3e81f2b40.tar.bz2 fasthttp-d0df1e1dde9159848f2153989461e0a3e81f2b40.zip |
Add ResetUserValues() and test (#1056)
Diffstat (limited to 'server_test.go')
-rw-r--r-- | server_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/server_test.go b/server_test.go index b2f1d7e..590502e 100644 --- a/server_test.go +++ b/server_test.go @@ -1757,6 +1757,15 @@ func TestRequestCtxUserValue(t *testing.T) { if len(ctx.userValues) != vlen { t.Fatalf("the length of user values returned from VisitUserValues is not equal to the length of the userValues, expecting: %d but got: %d", len(ctx.userValues), vlen) } + + ctx.ResetUserValues() + for i := 0; i < 10; i++ { + k := fmt.Sprintf("key-%d", i) + v := ctx.UserValue(k) + if v != nil { + t.Fatalf("unexpected value obtained for key %q: %v. Expecting nil", k, v) + } + } } func TestServerHeadRequest(t *testing.T) { |