testhelper

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireLog

func RequireLog(t *testing.T, dir string, bs *bytes.Buffer)

Types

type SyncWriter added in v1.2.0

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

SyncWriter wraps an io.Writer to make it safe for concurrent use.

func NewSyncWriter added in v1.2.0

func NewSyncWriter(w io.Writer) *SyncWriter

NewSyncWriter creates a new thread-safe writer.

func (*SyncWriter) Write added in v1.2.0

func (sw *SyncWriter) Write(p []byte) (n int, err error)

Write implements io.Writer in a thread-safe manner.

type TestFs

type TestFs struct {
	Cwd string

	GlobFixtures map[string][]string
	DeleteFile   func(string) error
	// contains filtered or unexported fields
}

func NewTestFs

func NewTestFs(files map[string]string) *TestFs

func (*TestFs) Abs

func (f *TestFs) Abs(path string) (string, error)

func (*TestFs) Chdir

func (f *TestFs) Chdir(dir string) error

func (*TestFs) DirectoryExistsAt

func (f *TestFs) DirectoryExistsAt(path string) bool

func (*TestFs) FileExists

func (f *TestFs) FileExists(path string) (bool, error)

func (*TestFs) FileExistsAt

func (f *TestFs) FileExistsAt(path string) bool

func (*TestFs) FileReaderCalls

func (f *TestFs) FileReaderCalls() int

func (*TestFs) Getwd

func (f *TestFs) Getwd() (string, error)

func (*TestFs) Glob

func (f *TestFs) Glob(relPattern string) ([]string, error)

func (*TestFs) ReadFile

func (f *TestFs) ReadFile(filename string) ([]byte, error)

func (*TestFs) SuccessfulReads

func (f *TestFs) SuccessfulReads() []string

func (*TestFs) ToFileSystem added in v0.145.4

func (f *TestFs) ToFileSystem() *ffs.FileSystem

Jump to

Keyboard shortcuts

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