testhelper

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 5 Imported by: ? 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

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