testing

package
v0.0.0-...-da552d6 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GoodParams represent some good tinygraphs parameters to test.
	GoodParams []map[string]string
	// BadParams represent some bad, wrong parameters to test.
	BadParams []map[string]string
)

Functions

This section is empty.

Types

type HandlerFunc

type HandlerFunc func(url, method string, params map[string]string, r *route.Router) *httptest.ResponseRecorder

HandlerFunc type returns an httptest.ResponseRecorder when you pass the following params: url: the url you want to query. params: the parameters that the url should use. r: the router to record the httptest.ResponseRecorder.

func GenerateHandlerFunc

func GenerateHandlerFunc(t *testing.T, handler func(http.ResponseWriter, *http.Request)) HandlerFunc

GenerateHandlerFunc returns a HandlerFunc type based on the handler passed as argument.

Jump to

Keyboard shortcuts

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