tests

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorruptFile

func CorruptFile(t *testing.T, file string)

func CorruptFiles

func CorruptFiles(t *testing.T, dir string)

func OpenStore

func OpenStore(t *testing.T, options ...store.Option) *store.Store

func ReadData

func ReadData(t *testing.T, s *store.Store, options ...store.ReaderOption) []byte

func TempDir

func TempDir(t *testing.T) string

func TouchFile

func TouchFile(t *testing.T, path string)

func UpdateFiles

func UpdateFiles(t *testing.T, dir, extension string, newContent string)

func WriteData

func WriteData(t *testing.T, s *store.Store, bytes []byte, writerOptions ...store.WriterOption) store.Version

Types

type Async

type Async struct {
	// contains filtered or unexported fields
}

func RunAsync

func RunAsync(f func()) Async

func (*Async) WaitOrFailAfter

func (a *Async) WaitOrFailAfter(t *testing.T, timeout time.Duration)

type FakeDecoder

type FakeDecoder struct {
	// contains filtered or unexported fields
}

func (*FakeDecoder) DataRead

func (f *FakeDecoder) DataRead() []byte

func (*FakeDecoder) Decode

func (f *FakeDecoder) Decode(reader io.Reader) error

type ReaderFailingOnClose

type ReaderFailingOnClose struct {
	ReaderMock
}

func (*ReaderFailingOnClose) Close

func (r *ReaderFailingOnClose) Close() error

type ReaderFailingOnRead

type ReaderFailingOnRead struct {
	ReaderMock
}

func (*ReaderFailingOnRead) Read

func (r *ReaderFailingOnRead) Read([]byte) (n int, err error)

type ReaderMock

type ReaderMock struct{}

func (*ReaderMock) Close

func (r *ReaderMock) Close() error

func (*ReaderMock) Read

func (r *ReaderMock) Read(p []byte) (n int, err error)

func (*ReaderMock) Version

func (r *ReaderMock) Version() store.Version

type StoreMock

type StoreMock struct {
	ReturnReader        store.Reader
	ReturnReaderError   error
	ReturnVersions      []store.Version
	ReturnVersionsError error
	ReturnWriter        store.Writer
}

func (*StoreMock) Reader

func (s *StoreMock) Reader(...store.ReaderOption) (store.Reader, error)

func (*StoreMock) Versions

func (s *StoreMock) Versions() ([]store.Version, error)

func (*StoreMock) Writer

func (s *StoreMock) Writer(...store.WriterOption) (store.Writer, error)

type WriterMock

type WriterMock struct {
	// contains filtered or unexported fields
}

func (*WriterMock) AbortAndClose

func (w *WriterMock) AbortAndClose()

func (*WriterMock) Close

func (w *WriterMock) Close() error

func (*WriterMock) IsAborted

func (w *WriterMock) IsAborted() bool

func (*WriterMock) Version

func (w *WriterMock) Version() store.Version

func (*WriterMock) Write

func (w *WriterMock) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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