routertest

package
v1.80.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package routertest provides a backend-agnostic conformance suite for the httpx.Router seam. Every adapter (stdrouter, chirouter, ginrouter, or a future one) must pass RunConformance to be a drop-in substitute — the framework relies on canonical :id / *rest routing, exact root/sub-path matching, a NoRoute fallback, ordered middleware with Abort, group prefixes, and Static behaving identically regardless of the concrete router underneath.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunConformance

func RunConformance(t *testing.T, newRouter func() httpx.Router)

RunConformance runs the full router contract against routers produced by newRouter. Each subtest gets a fresh router. Call it from each adapter's test package:

func TestConformance(t *testing.T) { routertest.RunConformance(t, func() httpx.Router { return New() }) }

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL