worldtest

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestWorld

func NewTestWorld(env map[string]string, files map[string][]byte) world.World

Types

type MapEnv

type MapEnv struct {
	Map      map[string]string
	ExitCode *int
}

func NewMapEnv

func NewMapEnv(m map[string]string) *MapEnv

func (*MapEnv) Environ added in v0.0.19

func (e *MapEnv) Environ() []string

func (*MapEnv) Exit

func (e *MapEnv) Exit(code int)

func (*MapEnv) LookupEnv

func (e *MapEnv) LookupEnv(key string) (string, bool)

type MapFS

type MapFS struct {
	fstest.MapFS
	Cwd struct {
		// contains filtered or unexported fields
	}
}

func NewMapFS

func NewMapFS(m map[string][]byte) *MapFS

func (*MapFS) Getwd

func (m *MapFS) Getwd() (string, error)

func (*MapFS) Glob

func (m *MapFS) Glob(name string) ([]string, error)

func (*MapFS) PathSeparator

func (m *MapFS) PathSeparator() rune

func (*MapFS) ReadFile

func (m *MapFS) ReadFile(name string) ([]byte, error)

func (*MapFS) Remove

func (m *MapFS) Remove(name string) error

func (*MapFS) Stat

func (m *MapFS) Stat(name string) (fs.FileInfo, error)

func (*MapFS) WriteFile

func (m *MapFS) WriteFile(name string, data []byte, perm fs.FileMode) error

Jump to

Keyboard shortcuts

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