tests

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 11 Imported by: 0

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 added in v0.5.0

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

func UpdateFiles added in v0.5.0

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 added in v0.4.0

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

func (*FakeDecoder) DataRead added in v0.4.0

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

func (*FakeDecoder) Decode added in v0.4.0

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

type ReaderFailingOnClose added in v0.4.0

type ReaderFailingOnClose struct {
	ReaderMock
}

func (*ReaderFailingOnClose) Close added in v0.4.0

func (r *ReaderFailingOnClose) Close() error

type ReaderFailingOnRead added in v0.4.0

type ReaderFailingOnRead struct {
	ReaderMock
}

func (*ReaderFailingOnRead) Read added in v0.4.0

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

type ReaderMock added in v0.4.0

type ReaderMock struct{}

func (*ReaderMock) Close added in v0.4.0

func (r *ReaderMock) Close() error

func (*ReaderMock) Read added in v0.4.0

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

func (*ReaderMock) Version added in v0.4.0

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

type StoreMock added in v0.4.0

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

func (*StoreMock) Reader added in v0.4.0

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

func (*StoreMock) Versions added in v0.4.0

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

func (*StoreMock) Writer added in v0.4.0

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

type WriterMock added in v0.4.0

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

func (*WriterMock) AbortAndClose added in v0.4.0

func (w *WriterMock) AbortAndClose()

func (*WriterMock) Close added in v0.4.0

func (w *WriterMock) Close() error

func (*WriterMock) IsAborted added in v0.4.0

func (w *WriterMock) IsAborted() bool

func (*WriterMock) Version added in v0.4.0

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

func (*WriterMock) Write added in v0.4.0

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