testutil

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package testutil holds small assertion helpers shared across this repo's test files. It is a regular (non-_test.go) package so it can be imported from other packages' tests, unlike a _test.go file which Go restricts to its own package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireBadReqCode

func RequireBadReqCode(t *testing.T, err error, wantCode string)

RequireBadReqCode asserts that errors.As finds a *model.CodedErr in err, that its status is 400, and that its BecknError().Code equals wantCode. Shared by every plugin test suite that classifies failures as bad requests (reqmapper, router, reqpreprocessor, encrypter, decrypter, ...) instead of each reimplementing the same assertion locally.

The status is checked because one CodedErr type now covers 400, 401 and 404, so matching the type alone would also accept the other two.

Types

This section is empty.

Jump to

Keyboard shortcuts

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