adapter_test.go — fiber Source File
Architecture documentation for adapter_test.go, a go file in the fiber codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 3ad7a4ef_7f07_008c_234d_52c9a342aa98["adapter_test.go"] fcef1725_af89_d6cd_36cd_b228cdcc5acd["errors"] 3ad7a4ef_7f07_008c_234d_52c9a342aa98 --> fcef1725_af89_d6cd_36cd_b228cdcc5acd style 3ad7a4ef_7f07_008c_234d_52c9a342aa98 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
package fiber
import (
"errors"
"fmt"
"io"
"net/http"
"net/http/httptest"
"os"
"reflect"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/valyala/fasthttp"
)
func TestToFiberHandler_Nil(t *testing.T) {
t.Parallel()
var handler Handler
converted, ok := toFiberHandler(handler)
require.False(t, ok)
require.Nil(t, converted)
}
func TestToFiberHandler_FiberHandler(t *testing.T) {
t.Parallel()
fiberHandler := func(c Ctx) error { return c.SendStatus(http.StatusAccepted) }
converted, ok := toFiberHandler(fiberHandler)
require.True(t, ok)
require.NotNil(t, converted)
require.Equal(t, reflect.ValueOf(fiberHandler).Pointer(), reflect.ValueOf(converted).Pointer())
}
func TestToFiberHandler_FiberHandlerNoErrorReturn(t *testing.T) {
t.Parallel()
app, ctx := newTestCtx(t)
handler := func(c Ctx) {
require.Equal(t, app, c.App())
c.Set("X-Handler", "ok")
}
converted, ok := toFiberHandler(handler)
require.True(t, ok)
require.NotNil(t, converted)
require.NoError(t, converted(ctx))
require.Equal(t, "ok", string(ctx.Response().Header.Peek("X-Handler")))
}
func TestNewTestCtx_ReturnsDefaultCtx(t *testing.T) {
t.Parallel()
app, ctx := newTestCtx(t)
// ... (919 more lines)
Domain
Subdomains
Functions
- ResponseWriter()
- TestAdapter_MixedHandlerIntegration()
- TestCollectHandlers_FasthttpHandler()
- TestCollectHandlers_FiberHandlerNoErrorReturn()
- TestCollectHandlers_HTTPHandler()
- TestCollectHandlers_InvalidType()
- TestCollectHandlers_MixedHandlers()
- TestCollectHandlers_Nil()
- TestCollectHandlers_TypedNilFasthttpHandlers()
- TestCollectHandlers_TypedNilFuncHTTPHandler()
- TestCollectHandlers_TypedNilHTTPHandlers()
- TestCollectHandlers_TypedNilPointerHTTPHandler()
- TestNewTestCtx_ReturnsDefaultCtx()
- TestToFiberHandler_ExpressNextNoArgMiddleware()
- TestToFiberHandler_ExpressNextNoArgPropagatesError()
- TestToFiberHandler_ExpressNextNoArgStopsChain()
- TestToFiberHandler_ExpressNextNoArgWithErrorReturn()
- TestToFiberHandler_ExpressNextWithErrorContinuesOnNil()
- TestToFiberHandler_ExpressNextWithErrorReturnCallback_PropagatesNextError()
- TestToFiberHandler_ExpressNextWithErrorReturnCallback_ShortCircuitsOnNextError()
- TestToFiberHandler_ExpressNextWithErrorReturnCallback_StopsChainWithoutNextCall()
- TestToFiberHandler_ExpressNextWithErrorReturn_PrefersHandlerErrorOverNextError()
- TestToFiberHandler_ExpressNextWithErrorReturn_PropagatesNextErrorWhenNoReturnError()
- TestToFiberHandler_ExpressNextWithErrorReturn_ShortCircuitsOnNextError()
- TestToFiberHandler_ExpressNextWithErrorShortCircuitsOnError()
- TestToFiberHandler_ExpressThreeParamsWithError()
- TestToFiberHandler_ExpressThreeParamsWithoutError()
- TestToFiberHandler_ExpressTwoParamsWithError()
- TestToFiberHandler_ExpressTwoParamsWithoutError()
- TestToFiberHandler_FasthttpHandlerWithError()
- TestToFiberHandler_FiberHandler()
- TestToFiberHandler_FiberHandlerNoErrorReturn()
- TestToFiberHandler_HTTPHandler()
- TestToFiberHandler_HTTPHandlerFunc()
- TestToFiberHandler_HTTPHandler_Flush()
- TestToFiberHandler_Nil()
- TestWrapHTTPHandler_Flush_App_Test()
- TestWrapHTTPHandler_Nil()
- Test_HTTPHandler_App_Test_Interrupted()
- newTestCtx()
- withRouteHandlers()
Dependencies
- errors
Source
Frequently Asked Questions
What does adapter_test.go do?
adapter_test.go is a source file in the fiber codebase, written in go. It belongs to the FiberCore domain, Adapters subdomain.
What functions are defined in adapter_test.go?
adapter_test.go defines 41 function(s): ResponseWriter, TestAdapter_MixedHandlerIntegration, TestCollectHandlers_FasthttpHandler, TestCollectHandlers_FiberHandlerNoErrorReturn, TestCollectHandlers_HTTPHandler, TestCollectHandlers_InvalidType, TestCollectHandlers_MixedHandlers, TestCollectHandlers_Nil, TestCollectHandlers_TypedNilFasthttpHandlers, TestCollectHandlers_TypedNilFuncHTTPHandler, and 31 more.
What does adapter_test.go depend on?
adapter_test.go imports 1 module(s): errors.
Where is adapter_test.go in the architecture?
adapter_test.go is located at adapter_test.go (domain: FiberCore, subdomain: Adapters).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free