lib/ignore, lib/model: Use an interface to detect file changes, improving tests

This solves the erratic test failures on model.TestIgnores by ensuring
that the ignore patterns are reloaded even in the face of unchanged
timestamps.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4208
This commit is contained in:
Jakob Borg
2017-06-11 10:27:12 +00:00
committed by Audrius Butkevicius
parent 2a38d2a3d2
commit 68c1a0b9b4
7 changed files with 195 additions and 87 deletions

View File

@@ -54,7 +54,7 @@ func init() {
}
func TestWalkSub(t *testing.T) {
ignores := ignore.New(false)
ignores := ignore.New()
err := ignores.Load("testdata/.stignore")
if err != nil {
t.Fatal(err)
@@ -90,7 +90,7 @@ func TestWalkSub(t *testing.T) {
}
func TestWalk(t *testing.T) {
ignores := ignore.New(false)
ignores := ignore.New()
err := ignores.Load("testdata/.stignore")
if err != nil {
t.Fatal(err)