Debian Codegraph @

internal/rsynctest/rsynctest_windows.go

raw symbols SCIP
1 //go:build windows
2
3 package rsynctest
4
5 import (
6 "os"
7 "testing"
8 )
9
10 func CreateDummyDeviceFiles(t *testing.T, dir string) {
11 t.Skip("Windows does not support special files (devices/FIFOs/sockets)")
12 }
13
14 func VerifyDummyDeviceFiles(t *testing.T, source, dest string) {
15 t.Skip("Windows does not support special files (devices/FIFOs/sockets)")
16 }
17
18 // StatUidGid is not meaningful on Windows (no Unix file ownership).
19 //
20 // Callers are supposed to check os.Getuid()==-1 and skip.
21 // Hence, this function must compile but is never reached.
22 func StatUidGid(t *testing.T, fi os.FileInfo) (uid, gid int) {
23 t.Fatal("BUG: StatUidGid not skipped on Windows")
24 return 0, 0
25 }
26
27 // ReplaceSymlink atomically replaces newname with a symlink to oldname.
28 //
29 // On Unix, this function works atomically,
30 // on Windows it falls back to non-atomic behavior.
31 func ReplaceSymlink(t *testing.T, oldname, newname string) {
32 t.Helper()
33 if err := os.Remove(newname); err != nil && !os.IsNotExist(err) {
34 t.Fatal(err)
35 }
36 if err := os.Symlink(oldname, newname); err != nil {
37 t.Skipf("cannot create symlinks on this Windows host: %v", err)
38 }
39 }