fs: add ChangeNotify and backend support for it (#2094)
* fs: rename DirChangeNotify to ChangeNotify * cache: switch to ChangeNotify * ChangeNotify: keep order of notifications
This commit is contained in:
parent
b3f55d6bda
commit
70f07fd3ac
35 changed files with 447 additions and 230 deletions
|
@ -7,6 +7,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/ncw/rclone/fs"
|
||||
"github.com/ncw/rclone/fstest"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
@ -113,11 +114,11 @@ func TestDirForgetPath(t *testing.T) {
|
|||
assert.Equal(t, 1, len(root.items))
|
||||
assert.Equal(t, 1, len(dir.items))
|
||||
|
||||
root.ForgetPath("dir")
|
||||
root.ForgetPath("dir", fs.EntryDirectory)
|
||||
assert.Equal(t, 1, len(root.items))
|
||||
assert.Equal(t, 0, len(dir.items))
|
||||
|
||||
root.ForgetPath("not/in/cache")
|
||||
root.ForgetPath("not/in/cache", fs.EntryDirectory)
|
||||
assert.Equal(t, 1, len(root.items))
|
||||
assert.Equal(t, 0, len(dir.items))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue