mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 14:56:29 +00:00
archiver/Windows: Skip test new-content-same-filestamp
This commit is contained in:
parent
355db0bc29
commit
b016dc2ff0
@ -558,6 +558,7 @@ func TestFileChanged(t *testing.T) {
|
|||||||
|
|
||||||
var tests = []struct {
|
var tests = []struct {
|
||||||
Name string
|
Name string
|
||||||
|
SkipForWindows bool
|
||||||
Content []byte
|
Content []byte
|
||||||
Modify func(t testing.TB, filename string)
|
Modify func(t testing.TB, filename string)
|
||||||
IgnoreInode bool
|
IgnoreInode bool
|
||||||
@ -580,6 +581,10 @@ func TestFileChanged(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "new-content-same-timestamp",
|
Name: "new-content-same-timestamp",
|
||||||
|
// on Windows, there's no "create time" field users cannot modify,
|
||||||
|
// so we're unable to detect if a file has been modified when the
|
||||||
|
// timestamps are reset, so we skip this test for Windows
|
||||||
|
SkipForWindows: true,
|
||||||
Modify: func(t testing.TB, filename string) {
|
Modify: func(t testing.TB, filename string) {
|
||||||
fi, err := os.Stat(filename)
|
fi, err := os.Stat(filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -629,6 +634,10 @@ func TestFileChanged(t *testing.T) {
|
|||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
t.Run(test.Name, func(t *testing.T) {
|
t.Run(test.Name, func(t *testing.T) {
|
||||||
|
if runtime.GOOS == "windows" && test.SkipForWindows {
|
||||||
|
t.Skip("don't run test on Windows")
|
||||||
|
}
|
||||||
|
|
||||||
tempdir, cleanup := restictest.TempDir(t)
|
tempdir, cleanup := restictest.TempDir(t)
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user