github.com/mckael/restic@v0.8.3/cmd/restic/integration_helpers_windows_test.go (about) 1 //+build windows 2 3 package main 4 5 import ( 6 "fmt" 7 "io/ioutil" 8 "os" 9 ) 10 11 func (e *dirEntry) equals(other *dirEntry) bool { 12 if e.path != other.path { 13 fmt.Fprintf(os.Stderr, "%v: path does not match (%v != %v)\n", e.path, e.path, other.path) 14 return false 15 } 16 17 if e.fi.Mode() != other.fi.Mode() { 18 fmt.Fprintf(os.Stderr, "%v: mode does not match (%v != %v)\n", e.path, e.fi.Mode(), other.fi.Mode()) 19 return false 20 } 21 22 if !sameModTime(e.fi, other.fi) { 23 fmt.Fprintf(os.Stderr, "%v: ModTime does not match (%v != %v)\n", e.path, e.fi.ModTime(), other.fi.ModTime()) 24 return false 25 } 26 27 return true 28 } 29 30 func nlink(info os.FileInfo) uint64 { 31 return 1 32 } 33 34 func inode(info os.FileInfo) uint64 { 35 return uint64(0) 36 } 37 38 func createFileSetPerHardlink(dir string) map[uint64][]string { 39 linkTests := make(map[uint64][]string) 40 files, err := ioutil.ReadDir(dir) 41 if err != nil { 42 return nil 43 } 44 for i, f := range files { 45 linkTests[uint64(i)] = append(linkTests[uint64(i)], f.Name()) 46 i++ 47 } 48 return linkTests 49 }