From 40519818d512649d59ec66ed54065ee7d7b8fe5f Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Tue, 17 Mar 2015 16:14:37 +1100 Subject: [PATCH] Clarified the expectations in a couple of tests. --- samples/cachingfs/caching_fs_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/samples/cachingfs/caching_fs_test.go b/samples/cachingfs/caching_fs_test.go index d570a08..0e1bf96 100644 --- a/samples/cachingfs/caching_fs_test.go +++ b/samples/cachingfs/caching_fs_test.go @@ -446,15 +446,16 @@ func (t *AttributeCachingTest) StatRenumberStat() { ExpectEq(t.fs.BarID(), getInodeID(barAfter)) } -func (t *AttributeCachingTest) StatMtimeStat() { +func (t *AttributeCachingTest) StatMtimeStat_ViaPath() { newMtime := t.initialMtime.Add(time.Second) t.statAll() t.fs.SetMtime(newMtime) fooAfter, dirAfter, barAfter := t.statAll() - // We should see the new attributes, since the entry had to be looked up - // again and the new attributes were returned with the entry. + // Since we don't have entry caching enabled, the call above had to look up + // the entry again. With the lookup we returned new attributes, so we expect + // that the mtime will be fresh. ExpectThat(fooAfter.ModTime(), timeutil.TimeEq(newMtime)) ExpectThat(dirAfter.ModTime(), timeutil.TimeEq(newMtime)) ExpectThat(barAfter.ModTime(), timeutil.TimeEq(newMtime)) @@ -490,7 +491,7 @@ func (t *AttributeCachingTest) StatMtimeStat_ViaFileDescriptor() { ExpectThat(barAfter.ModTime(), timeutil.TimeEq(newMtime)) } -func (t *AttributeCachingTest) StatRenumberMtimeStat() { +func (t *AttributeCachingTest) StatRenumberMtimeStat_ViaPath() { newMtime := t.initialMtime.Add(time.Second) t.statAll() @@ -500,7 +501,7 @@ func (t *AttributeCachingTest) StatRenumberMtimeStat() { // We should see new everything, because this is the first time the new // inodes have been encountered. Entries for the old ones should not have - // been cached. + // been cached, because we have entry caching disabled. ExpectEq(t.fs.FooID(), getInodeID(fooAfter)) ExpectEq(t.fs.DirID(), getInodeID(dirAfter)) ExpectEq(t.fs.BarID(), getInodeID(barAfter))