test_test

package
v0.0.0-...-75bc78b Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadBytes

func LoadBytes(t *testing.T, name string) []byte

LoadBytes is helper to load file contents from testdata directory

func LoadJSON

func LoadJSON(t *testing.T, filename string, targe interface{})

LoadJSON is helper to load JSON file contents from testdata directory into target struct/slice

func UTCTime

func UTCTime(sec int64) time.Time

UTCTime creates instance of time in UTC timezone this helps avoid problems running tests with different timezone computers

Types

type MockReaderWriter

type MockReaderWriter struct {
	Reads  []ReadResult
	Writes []WriteResult
	// contains filtered or unexported fields
}

func (*MockReaderWriter) Read

func (m *MockReaderWriter) Read(p []byte) (n int, err error)

func (*MockReaderWriter) Write

func (m *MockReaderWriter) Write(p []byte) (n int, err error)

type ReadResult

type ReadResult struct {
	Read []byte
	Err  error
}

type WriteResult

type WriteResult struct {
	N   int
	Err error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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