Test Go bindings for FilePurger.

Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/fb69e384
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/fb69e384
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/fb69e384

Branch: refs/heads/master
Commit: fb69e384524d563aa0636070fcc2159970003acd
Parents: 656f693
Author: Marvin Humphrey <[email protected]>
Authored: Sun Nov 1 09:58:37 2015 -0800
Committer: Marvin Humphrey <[email protected]>
Committed: Sun Nov 1 10:00:36 2015 -0800

----------------------------------------------------------------------
 go/lucy/index_test.go | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/fb69e384/go/lucy/index_test.go
----------------------------------------------------------------------
diff --git a/go/lucy/index_test.go b/go/lucy/index_test.go
index 47cb461..76f35f7 100644
--- a/go/lucy/index_test.go
+++ b/go/lucy/index_test.go
@@ -527,3 +527,20 @@ func TestSegmentMisc(t *testing.T) {
                t.Errorf("CompareTo (seg 4 vs seg 5): %d", got)
        }
 }
+
+func TestFilePurgerMisc(t *testing.T) {
+       folder := NewRAMFolder("")
+       oldSnapshot := NewSnapshot()
+       oldSnapshot.AddEntry("foo")
+       out, _ := folder.OpenOut("foo")
+       out.Close()
+       oldSnapshot.WriteFile(folder, "")
+
+       snapshot := NewSnapshot()
+       snapshot.WriteFile(folder, "")
+       purger := NewFilePurger(folder, snapshot, nil)
+       purger.Purge()
+       if folder.Exists("foo") {
+               t.Errorf("Failed to purge file")
+       }
+}

Reply via email to