Documentation ¶
Index ¶
- func TestFS(fsys fs.FS, files ...TestFSFile) error
- func TestFileAppend(fsys fs.FS, name string, data []byte) error
- func TestFileOpen(fsys fs.FS, name string, data []byte) (retErr error)
- func TestFileWrite(fsys fs.FS, name string, data []byte) error
- type MapFS
- func (m *MapFS) Chtimes(name string, atime, mtime time.Time) error
- func (m *MapFS) FullFilePath(name string) (string, error)
- func (m *MapFS) Glob(pattern string) ([]string, error)
- func (m *MapFS) Lstat(name string) (fs.FileInfo, error)
- func (m *MapFS) Open(name string) (fs.File, error)
- func (m *MapFS) OpenFile(name string, flag int, mode fs.FileMode) (kfs.File, error)
- func (m *MapFS) ReadDir(name string) ([]fs.DirEntry, error)
- func (m *MapFS) ReadFile(name string) ([]byte, error)
- func (m *MapFS) ReadLink(name string) (string, error)
- func (m *MapFS) Remove(name string) error
- func (m *MapFS) RemoveAll(name string) error
- func (m *MapFS) Stat(name string) (fs.FileInfo, error)
- func (m *MapFS) Sub(dir string) (fs.FS, error)
- type TestFSFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestFS ¶
func TestFS(fsys fs.FS, files ...TestFSFile) error
TestFS tests fs operations:
- Open
- Stat
- ReadFile
- ReadDir
- Glob
- Sub
func TestFileAppend ¶
TestFileAppend tests appending to a file with kfs.OpenFile
func TestFileOpen ¶
TestFileOpen tests reading a file using Open
func TestFileWrite ¶
TestFileWrite tests writing a file with kfs.OpenFile
Types ¶
type MapFS ¶
MapFS is an in-memory kfs.FS
func (*MapFS) FullFilePath ¶ added in v0.1.3
type TestFSFile ¶
TestFSFile specifies files to test by TestFS
Click to show internal directories.
Click to hide internal directories.