fiber/binder/binder_test.go
M. Efe Çetin 57744ebbe8
🐛 bug: fix EnableSplittingOnParsers is not functional (#3231)
* 🐛 bug: fix EnableSplittingOnParsers is not functional

* remove wrong testcase

* add support for external xml decoders

* improve test coverage

* fix linter

* update

* add reset methods

* improve test coverage

* merge Form and MultipartForm methods

* fix linter

* split reset and putting steps

* fix linter
2024-12-25 12:53:14 +01:00

29 lines
769 B
Go

package binder
import (
"testing"
"github.com/stretchr/testify/require"
)
func Test_GetAndPutToThePool(t *testing.T) {
t.Parallel()
// Panics in case we get from another pool
require.Panics(t, func() {
_ = GetFromThePool[*HeaderBinding](&CookieBinderPool)
})
// We get from the pool
binder := GetFromThePool[*HeaderBinding](&HeaderBinderPool)
PutToThePool(&HeaderBinderPool, binder)
_ = GetFromThePool[*RespHeaderBinding](&RespHeaderBinderPool)
_ = GetFromThePool[*QueryBinding](&QueryBinderPool)
_ = GetFromThePool[*FormBinding](&FormBinderPool)
_ = GetFromThePool[*URIBinding](&URIBinderPool)
_ = GetFromThePool[*XMLBinding](&XMLBinderPool)
_ = GetFromThePool[*JSONBinding](&JSONBinderPool)
_ = GetFromThePool[*CBORBinding](&CBORBinderPool)
}