wfstest

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package wfstest implements support for testing implementations and users of file systems.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestRenameFS added in v0.4.1

func TestRenameFS(fsys fs.FS, tmpDir string) error

TestRenameFS tests a wfs.RenameFS implementation. It assumes the filesystem also implements wfs.WriteFileFS so it can stage source files. tmpDir is a directory the test may freely create and destroy entries under.

func TestWriteFileFS

func TestWriteFileFS(fsys fs.FS, tmpDir string) error

TestWriteFileFS tests a wfs.WriteFileFS implementation.

Typical usage inside a test is:

tmpDir, err := os.MkdirTemp("", "test")
if err != nil {
  t.Fatal(err)
}
defer os.RemoveAll(tmpDir)

fsys := osfs.New(filepath.Dir(tmpDir))
if err := wfstest.TestWriteFileFS(fsys, filepath.Base(tmpDir)); err != nil {
  t.Fatal(err)
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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