fstest

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package fstest provides functions for testing implementations of the io/fs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultContainerTests

func GetDefaultContainerTests() map[string]*PathTest

GetDefaultContainerTests returns a set of default tests for the test data.

func Readdirnames

func Readdirnames(file fs.File, n int) (names []string, err error)

func RunTest

func RunTest(t *testing.T, name, file string, newFunc func(fsio.ReadSeekerAt) (fs.FS, error), tests map[string]*PathTest)

RunTest executes a set of tests.

Types

type PathTest

type PathTest struct {
	TestName         string
	Path             string
	FileName         string
	InfoSize         int64
	InfoMode         fs.FileMode
	InfoModTime      time.Time
	InfoIsDir        bool
	InfoSys          interface{}
	FileReaddirnames []string
	Head             []byte
}

PathTest is a single test for file systems.

type Readdirnamer

type Readdirnamer interface {
	Readdirnames(n int) ([]string, error)
}

Jump to

Keyboard shortcuts

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