2019-05-04 08:34:28 +00:00
|
|
|
// +build windows
|
|
|
|
|
|
|
|
package archiver
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
type wrappedFileInfo struct {
|
|
|
|
os.FileInfo
|
|
|
|
mode os.FileMode
|
|
|
|
}
|
|
|
|
|
|
|
|
func (fi wrappedFileInfo) Mode() os.FileMode {
|
|
|
|
return fi.mode
|
|
|
|
}
|
|
|
|
|
|
|
|
// wrapFileInfo returns a new os.FileInfo with the mode, owner, and group fields changed.
|
2019-05-05 12:57:38 +00:00
|
|
|
func wrapFileInfo(t testing.TB, fi os.FileInfo) os.FileInfo {
|
2019-05-04 08:34:28 +00:00
|
|
|
// wrap the os.FileInfo and return the modified mode, uid and gid are ignored on Windows
|
|
|
|
res := wrappedFileInfo{
|
|
|
|
FileInfo: fi,
|
2019-05-05 12:57:38 +00:00
|
|
|
mode: mockFileInfoMode,
|
2019-05-04 08:34:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return res
|
|
|
|
}
|