shared_tests

package
v0.0.0-...-5ddb564 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FakeFileName = "rootFile"
)

Variables

View Source
var (
	FakeContents = []byte(`hello world`)
	FakeFileInfo = vfs.FileInfo{
		Name:    FakeFileName,
		Size:    int64(len(FakeContents)),
		Mode:    0666,
		ModTime: time.Time{},
		IsDir:   false,
		Sys:     nil,
	}.Get()
)

Functions

func MakeTestFiles

func MakeTestFiles(t sktest.TestingT) string

MakeTestFiles creates a temporary directory containing the files and directories expected by TestFS.

func TestFS

func TestFS(ctx context.Context, t sktest.TestingT, fs vfs.FS)

TestFS tests a vfs.FS implementation. It expects the passed-in FS to have the following structure:

./
	subDir/
		subDirFile => "subDirFile contents"
	rootFile => FakeContents

func TestVFS_MultiWrite_ChangedToOriginal

func TestVFS_MultiWrite_ChangedToOriginal(t sktest.TestingT, fs vfs.FS)

func TestVFS_ReadOnly

func TestVFS_ReadOnly(t sktest.TestingT, fs vfs.FS)

func TestVFS_ReadWrite

func TestVFS_ReadWrite(t sktest.TestingT, fs vfs.FS)

Types

This section is empty.

Jump to

Keyboard shortcuts

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