fstest

package
v0.6.19 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Absent

type Absent struct {
	// Path is a filepath that will be treated relative to a base directory.
	Path string
}

func (Absent) Abs

func (a Absent) Abs(t *testing.T, pathBaseDir string) string

func (Absent) Assert

func (a Absent) Assert(t *testing.T, pathBaseDir string)

func (Absent) Write

func (a Absent) Write(t *testing.T, _ string)

type Absolute added in v0.6.2

type Absolute string

Absolute is a wrapper around a filepath that returns an absolute path.

func (Absolute) Resolve added in v0.6.2

func (a Absolute) Resolve(t *testing.T, pathBaseDir string) string

Filepath returns an absolute path to the wrapped path. If the underlying path is absolute then it must be a descendent of the provided base directory.

type Asserter

type Asserter interface {
	Assert(t *testing.T, pathBaseDir string)
}

type Dir

type Dir struct {
	// Path is a filepath that will be treated relative to a base directory.
	Path string
}

func (Dir) Abs

func (d Dir) Abs(t *testing.T, pathBaseDir string) string

func (Dir) Assert

func (d Dir) Assert(t *testing.T, pathBaseDir string)

func (Dir) Write

func (d Dir) Write(t *testing.T, pathBaseDir string)

type Exact added in v0.6.2

type Exact string

Exact is a wrapper around a filepath that is returned as-is.

func (Exact) Resolve added in v0.6.2

func (e Exact) Resolve(t *testing.T, _ string) string

type File

type File struct {
	// Path is a filepath that will be treated relative to a base directory.
	Path string
	// Contents are written to the created file.
	Contents string
}

func (File) Abs

func (f File) Abs(t *testing.T, pathBaseDir string) string

func (File) Assert

func (f File) Assert(t *testing.T, pathBaseDir string)

func (File) Write

func (f File) Write(t *testing.T, pathBaseDir string)

type Filepath added in v0.6.2

type Filepath interface {
	Resolve(t *testing.T, pathBaseDir string) string
}

type Relative added in v0.6.2

type Relative string

Relative is a wrapper around a filepath that returns a relative path.

func (Relative) Resolve added in v0.6.2

func (r Relative) Resolve(t *testing.T, pathBaseDir string) string

Filepath returns a filepath relative to the provided base directory. Fails if the underlying path cannot be made relative to the base directory.

type TarXZ

type TarXZ struct {
	// Path is a filepath that will be treated relative to a base directory.
	Path     string
	Contents []Writer
}

func (TarXZ) Abs

func (tr TarXZ) Abs(t *testing.T, pathBaseDir string) string

func (TarXZ) Write

func (tr TarXZ) Write(t *testing.T, pathBaseDir string)

type Writer

type Writer interface {
	Abs(t *testing.T, pathBaseDir string) string
	Write(t *testing.T, pathBaseDir string)
}

type Zip

type Zip struct {
	// Path is a filepath that will be treated relative to a base directory.
	Path     string
	Contents []Writer
}

func (Zip) Abs

func (z Zip) Abs(t *testing.T, pathBaseDir string) string

func (Zip) Write

func (z Zip) Write(t *testing.T, pathBaseDir string)

Jump to

Keyboard shortcuts

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