Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Commit

Permalink
Supply pools in header tests
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayjshah committed Apr 8, 2022
1 parent f8e62e4 commit 5c6b742
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
}

Expand Down

0 comments on commit 5c6b742

Please sign in to comment.