// Create separate test directory for each test case
path := filepath.Join(cwd, "testdata", "files-"+tc.name)
- err = os.Mkdir(path, 0700)
+ err := os.Mkdir(path, 0700)
if err != nil {
t.Fatal(err)
}
})
s.setDefaults()
- err := s.syncFiles()
+ err = s.syncFiles()
testutil.AssertErrorEqual(t, "err", err, tc.expErr)
dbg := res.Wait()
// Remove random file names from result
t.Run(tc.name, func(t *testing.T) {
// Create separate test directory for each test case
path := filepath.Join(cwd, "testdata", "file-"+tc.name)
- err = os.Mkdir(path, 0700)
+ err := os.Mkdir(path, 0700)
if err != nil {
t.Fatal(err)
}
rand.Seed(0)
var changed bool
- err := s.syncFile(tc.file, &changed)
+ err = s.syncFile(tc.file, &changed)
testutil.AssertErrorEqual(t, "err", err, tc.expErr)
dbg := res.Wait()
// Remove random file names from result