testutil

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package testutil provides shared test utilities and fixtures.

This package centralises common test helpers to reduce code duplication across test files and improve test maintainability.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertError

func AssertError(t *testing.T, err error)

AssertError fails the test if err is nil.

func AssertNoError

func AssertNoError(t *testing.T, err error)

AssertNoError fails the test if err is not nil.

func AssertStatusCode

func AssertStatusCode(t *testing.T, got, want int)

AssertStatusCode checks that the response status code matches expected.

func NewTestRecorder

func NewTestRecorder() *httptest.ResponseRecorder

NewTestRecorder creates a test response recorder.

func NewTestRequest

func NewTestRequest(method, path string) *http.Request

NewTestRequest creates a test HTTP request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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