testhelper

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package testhelper provides some useful helpers for testing in github.com/diskfs/go-diskfs subpackages

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DockerRun

func DockerRun(input io.Reader, output io.Writer, trust, rm bool, mounts map[string]string, img string, args ...string) error

DockerRun run a docker container thanks to moby/tool, which is licensed apache 2.0

func DumpByteSlicesWithDiffs added in v1.5.2

func DumpByteSlicesWithDiffs(a, b []byte, bytesPerRow int, showASCII, showPosHex, showPosDec bool) (different bool, out string)

dumpByteSlicesWithDiffs show two byte slices in hex and ASCII format, with differences highlighted.

Types

type FileImpl

type FileImpl struct {
	Reader reader
	Writer writer
}

FileImpl implement github.com/diskfs/go-diskfs/util/File used for testing to enable stubbing out files

func (*FileImpl) Close added in v1.5.0

func (f *FileImpl) Close() error

func (*FileImpl) Read added in v1.5.0

func (f *FileImpl) Read(b []byte) (int, error)

func (*FileImpl) ReadAt

func (f *FileImpl) ReadAt(b []byte, offset int64) (int, error)

ReadAt read at a particular offset

func (*FileImpl) Seek

func (f *FileImpl) Seek(offset int64, whence int) (int64, error)

Seek seek a particular offset - does not actually work

func (*FileImpl) Stat added in v1.5.0

func (f *FileImpl) Stat() (os.FileInfo, error)

func (*FileImpl) WriteAt

func (f *FileImpl) WriteAt(b []byte, offset int64) (int, error)

WriteAt write at a particular offset

Jump to

Keyboard shortcuts

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