Documentation ¶
Overview ¶
Package test is holds utility functions used for testing go packages acknowledgements :
Index ¶
- func ConcurrentCases() []int
- func NewDeleteRequest(endpoint string) (*http.Request, *httptest.ResponseRecorder)
- func NewGetRequest(endpoint string) (*http.Request, *httptest.ResponseRecorder)
- func NewPostRequestWithBody(endpoint string, body interface{}) (*http.Request, *httptest.ResponseRecorder)
- func NewRandomReader(blockSize int) io.Reader
- type CapturedStacktrace
- type RWTestCase
- type Reader
- type ReaderWriter
- type Writer
- type WriterTo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConcurrentCases ¶
func ConcurrentCases() []int
ConcurrentCases returns an array of integer which is used for number of cores when running concurrent benchmarks
func NewDeleteRequest ¶
func NewDeleteRequest(endpoint string) (*http.Request, *httptest.ResponseRecorder)
NewDeleteRequest ...
func NewGetRequest ¶
func NewGetRequest(endpoint string) (*http.Request, *httptest.ResponseRecorder)
NewGetRequest ...
func NewPostRequestWithBody ¶
func NewPostRequestWithBody(endpoint string, body interface{}) (*http.Request, *httptest.ResponseRecorder)
NewPostRequestWithBody ...
func NewRandomReader ¶
NewRandomReader - make a new random stream generator random reader is used to generate random streams of bytes used for testing io operations https://github.com/ncw/stressdisk
Types ¶
type CapturedStacktrace ¶
type CapturedStacktrace string
CapturedStacktrace ...
func Stacktrace ¶
func Stacktrace() CapturedStacktrace
Stacktrace - captures a stacktrace of the current goroutine github.com/hashicorp/go-hclog
type RWTestCase ¶
type RWTestCase struct { Size int Unit int Expect []byte CustomWriteTester func(t *testing.T, w Writer) CustomWriteToTester func(t *testing.T, w WriterTo) CustomReaderWriterTester func(t *testing.T, r ReaderWriter) }
RWTestCase define test cases used in testing Write([]byte) and Read([]byte) for unit , use values in primitives package
func GenerateRWTests ¶
func GenerateRWTests() []RWTestCase
GenerateRWTests generates test for to help with testing io.writer and readers
type ReaderWriter ¶
ReaderWriter ...