Home / File/ pprof_test.go — fiber Source File

pprof_test.go — fiber Source File

Architecture documentation for pprof_test.go, a go file in the fiber codebase. 1 imports, 0 dependents.

File go FiberCore Adapters 1 imports 10 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  bab7fd6d_604c_3199_e6a9_4920ae309ff5["pprof_test.go"]
  c0b86961_3ef1_0168_52fc_98627566ed27["bytes"]
  bab7fd6d_604c_3199_e6a9_4920ae309ff5 --> c0b86961_3ef1_0168_52fc_98627566ed27
  style bab7fd6d_604c_3199_e6a9_4920ae309ff5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

package pprof

import (
	"bytes"
	"io"
	"net/http"
	"net/http/httptest"
	"testing"
	"time"

	"github.com/gofiber/fiber/v3"
	"github.com/stretchr/testify/require"
)

var testConfig = fiber.TestConfig{
	Timeout:       5 * time.Second,
	FailOnTimeout: true,
}

func Test_Non_Pprof_Path(t *testing.T) {
	app := fiber.New()

	app.Use(New())

	app.Get("/", func(c fiber.Ctx) error {
		return c.SendString("escaped")
	})

	resp, err := app.Test(httptest.NewRequest(fiber.MethodGet, "/", http.NoBody))
	require.NoError(t, err)
	require.Equal(t, 200, resp.StatusCode)

	b, err := io.ReadAll(resp.Body)
	require.NoError(t, err)
	require.Equal(t, "escaped", string(b))
}

func Test_Non_Pprof_Path_WithPrefix(t *testing.T) {
	app := fiber.New()

	app.Use(New(Config{Prefix: "/federated-fiber"}))

	app.Get("/", func(c fiber.Ctx) error {
		return c.SendString("escaped")
	})

	resp, err := app.Test(httptest.NewRequest(fiber.MethodGet, "/", http.NoBody))
	require.NoError(t, err)
	require.Equal(t, 200, resp.StatusCode)

	b, err := io.ReadAll(resp.Body)
	require.NoError(t, err)
	require.Equal(t, "escaped", string(b))
}

func Test_Pprof_Index(t *testing.T) {
	app := fiber.New()

	app.Use(New())

// ... (146 more lines)

Domain

Subdomains

Classes

Dependencies

  • bytes

Frequently Asked Questions

What does pprof_test.go do?
pprof_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 pprof_test.go?
pprof_test.go defines 10 function(s): Test_Non_Pprof_Path, Test_Non_Pprof_Path_WithPrefix, Test_Pprof_Index, Test_Pprof_Index_WithPrefix, Test_Pprof_Next, Test_Pprof_Next_WithPrefix, Test_Pprof_Other, Test_Pprof_Other_WithPrefix, Test_Pprof_Subs, Test_Pprof_Subs_WithPrefix.
What does pprof_test.go depend on?
pprof_test.go imports 1 module(s): bytes.
Where is pprof_test.go in the architecture?
pprof_test.go is located at middleware/pprof/pprof_test.go (domain: FiberCore, subdomain: Adapters, directory: middleware/pprof).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free