testutil

package
v0.0.0-...-af569e1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertTestdataJSONEquals

func AssertTestdataJSONEquals(t *testing.T, path string, r io.Reader)

AssertTestdataJSONEquals asserts the testdata at path is equal to the JSON data in r, ignoring any whitespace and formatting.

func NewTestServer

func NewTestServer(t *testing.T, hf http.HandlerFunc) *httptest.Server

NewTestServer is a light wrapper around httptest.NewServer that closes the server when the test finishes and omits the need for casting to http.HandlerFunc.

func WriteTestdata

func WriteTestdata(t *testing.T, path string, w io.Writer)

WriteTestdata copies the file content at path to w, and fails the test on error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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