aboutsummaryrefslogtreecommitdiff
path: root/args_test.go
diff options
context:
space:
mode:
authorGravatar anshul-jain-aws <40903975+anshul-jain-aws@users.noreply.github.com> 2020-11-24 00:18:38 -0800
committerGravatar GitHub <noreply@github.com> 2020-11-24 09:18:38 +0100
commitf710c2d3209abfd10d4e44e385cfbb4792faa332 (patch)
treea20161fea8ec075709806698e0102b42c6d6bcfe /args_test.go
parentImprove round2 performance (#914) (diff)
downloadfasthttp-f710c2d3209abfd10d4e44e385cfbb4792faa332.tar.gz
fasthttp-f710c2d3209abfd10d4e44e385cfbb4792faa332.tar.bz2
fasthttp-f710c2d3209abfd10d4e44e385cfbb4792faa332.zip
Fixing deletion of headers/queryargs having multiple values. (#918)
Diffstat (limited to 'args_test.go')
-rw-r--r--args_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/args_test.go b/args_test.go
index f6c62ae..b2e1954 100644
--- a/args_test.go
+++ b/args_test.go
@@ -583,3 +583,17 @@ func testArgsParse(t *testing.T, a *Args, s string, expectedLen int, expectedArg
}
}
}
+
+func TestArgsDeleteAll(t *testing.T) {
+ t.Parallel()
+ var a Args
+ a.Add("q1", "foo")
+ a.Add("q1", "bar")
+ a.Add("q1", "baz")
+ a.Add("q1", "quux")
+ a.Add("q2", "1234")
+ a.Del("q1")
+ if a.Len() != 1 || a.Has("q1") {
+ t.Fatalf("Expected q1 arg to be completely deleted. Current Args: %s", a.String())
+ }
+} \ No newline at end of file