From 5c6b742ebbe1af06b076675a906cc0abee47b7de Mon Sep 17 00:00:00 2001 From: Akshay Shah Date: Fri, 8 Apr 2022 16:40:13 -0700 Subject: [PATCH] Supply pools in header tests --- header_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/header_test.go b/header_test.go index 559609e4..89ce25cd 100644 --- a/header_test.go +++ b/header_test.go @@ -42,12 +42,13 @@ func TestBinaryEncodingQuick(t *testing.T) { func TestPercentEncodingQuick(t *testing.T) { t.Parallel() + pool := newBufferPool() roundtrip := func(input string) bool { if !utf8.ValidString(input) { return true } - encoded := percentEncode(input) - decoded := percentDecode(encoded) + encoded := percentEncode(pool, input) + decoded := percentDecode(pool, encoded) return decoded == input } if err := quick.Check(roundtrip, nil /* config */); err != nil { @@ -57,11 +58,12 @@ func TestPercentEncodingQuick(t *testing.T) { func TestPercentEncoding(t *testing.T) { t.Parallel() + pool := newBufferPool() roundtrip := func(input string) { assert.True(t, utf8.ValidString(input), assert.Sprintf("input invalid UTF-8")) - encoded := percentEncode(input) + encoded := percentEncode(pool, input) t.Logf("%q encoded as %q", input, encoded) - decoded := percentDecode(encoded) + decoded := percentDecode(pool, encoded) assert.Equal(t, decoded, input) }