Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

filetesting

v0.0.0-20140813210533-fa988ea027e2
github.com/kapilt/testing/filetesting

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

23 matches

Top ↑

Types

Dir

type Dir struct {
	Path string
	Perm os.FileMode
}

Dir is an Entry that allows directories to be created and verified. The Path field should use "/" as the path separator.

Dir.Check

func (d Dir) Check(c *gc.C, basePath string) Entry

Dir.Create

func (d Dir) Create(c *gc.C, basePath string) Entry

Dir.GetPath

func (d Dir) GetPath() string

Entries

type Entries []Entry

Entries supplies convenience methods on Entry slices.

Entries.AsRemoveds

func (e Entries) AsRemoveds() Entries

AsRemoveds returns a slice of Removed entries whose paths correspond to those in e.

Entries.Check

func (e Entries) Check(c *gc.C, basePath string) Entries

Check checks every entry relative to basePath and returns a copy of itself.

Entries.Create

func (e Entries) Create(c *gc.C, basePath string) Entries

Create creates every entry relative to basePath and returns a copy of itself.

Entries.Paths

func (e Entries) Paths() []string

Paths returns the slash-separated path of every entry.

Entry

type Entry interface {

	// GetPath returns the slash-separated relative path that this
	// entry represents.
	GetPath() string

	// Create causes the entry to be created, relative to basePath. It returns
	// a copy of the receiver.
	Create(c *gc.C, basePath string) Entry

	// Check checks that the entry exists, relative to basePath, and matches
	// the entry that would be created by Create. It returns a copy of the
	// receiver.
	Check(c *gc.C, basePath string) Entry
}

Entry represents a filesystem entity that can be created; and whose correctness can be verified.

File

type File struct {
	Path string
	Data string
	Perm os.FileMode
}

File is an Entry that allows plain files to be created and verified. The Path field should use "/" as the path separator.

File.Check

func (f File) Check(c *gc.C, basePath string) Entry

File.Create

func (f File) Create(c *gc.C, basePath string) Entry

File.GetPath

func (f File) GetPath() string

Removed

type Removed struct {
	Path string
}

Removed is an Entry that indicates the absence of any entry. The Path field should use "/" as the path separator.

Removed.Check

func (r Removed) Check(c *gc.C, basePath string) Entry

Removed.Create

func (r Removed) Create(c *gc.C, basePath string) Entry

Removed.GetPath

func (r Removed) GetPath() string
type Symlink struct {
	Path string
	Link string
}

Symlink is an Entry that allows symlinks to be created and verified. The Path field should use "/" as the path separator.

Symlink.Check

func (s Symlink) Check(c *gc.C, basePath string) Entry

Symlink.Create

func (s Symlink) Create(c *gc.C, basePath string) Entry

Symlink.GetPath

func (s Symlink) GetPath() string

Dependency graph