fix watcher_hub

This commit is contained in:
Xiang Li
2013-11-06 21:19:37 -08:00
parent 55058c64f5
commit c307b6abca
6 changed files with 77 additions and 47 deletions

View File

@ -42,20 +42,20 @@ func TestScanHistory(t *testing.T) {
eh.addEvent(newEvent(Create, "/foo/foo/foo", 5, 1))
e, err := eh.scan("/foo", 1)
if err != nil || e.Index != 1 {
t.Fatalf("scan error [/foo] [1] %v", e.Index)
if err != nil || e[0].Index != 1 {
t.Fatalf("scan error [/foo] [1] %v", e[0].Index)
}
e, err = eh.scan("/foo/bar", 1)
if err != nil || e.Index != 2 {
t.Fatalf("scan error [/foo/bar] [2] %v", e.Index)
if err != nil || e[0].Index != 2 {
t.Fatalf("scan error [/foo/bar] [2] %v", e[0].Index)
}
e, err = eh.scan("/foo/bar", 3)
if err != nil || e.Index != 4 {
t.Fatalf("scan error [/foo/bar/bar] [4] %v", e.Index)
if err != nil || e[0].Index != 4 {
t.Fatalf("scan error [/foo/bar/bar] [4] %v", e[0].Index)
}
e, err = eh.scan("/foo/bar", 6)