mirror of
https://github.com/luxfi/filesystem.git
synced 2026-10-30 16:55:58 +00:00
34 lines
636 B
Go
34 lines
636 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package filesystem
|
|
|
|
import "io/fs"
|
|
|
|
var _ fs.DirEntry = MockFile{}
|
|
|
|
// MockFile is an implementation of fs.File for unit testing.
|
|
type MockFile struct {
|
|
MockName string
|
|
MockIsDir bool
|
|
MockType fs.FileMode
|
|
MockInfo fs.FileInfo
|
|
MockInfoErr error
|
|
}
|
|
|
|
func (m MockFile) Name() string {
|
|
return m.MockName
|
|
}
|
|
|
|
func (m MockFile) IsDir() bool {
|
|
return m.MockIsDir
|
|
}
|
|
|
|
func (m MockFile) Type() fs.FileMode {
|
|
return m.MockType
|
|
}
|
|
|
|
func (m MockFile) Info() (fs.FileInfo, error) {
|
|
return m.MockInfo, m.MockInfoErr
|
|
}
|