Test Go bindings for Posting.

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

Branch: refs/heads/master
Commit: d262be92763c9d145fd7fdcd3cef07cc8ec18a13
Parents: a693aa1
Author: Marvin Humphrey <[email protected]>
Authored: Thu Dec 3 19:13:19 2015 -0800
Committer: Marvin Humphrey <[email protected]>
Committed: Thu Dec 10 16:01:49 2015 -0800

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


http://git-wip-us.apache.org/repos/asf/lucy/blob/d262be92/go/lucy/index_test.go
----------------------------------------------------------------------
diff --git a/go/lucy/index_test.go b/go/lucy/index_test.go
index 5affb0d..88e8924 100644
--- a/go/lucy/index_test.go
+++ b/go/lucy/index_test.go
@@ -699,3 +699,16 @@ func TestPostingListBasics(t *testing.T) {
                t.Error("Next (done): %d", got)
        }
 }
+
+func TestPostingBasics(t *testing.T) {
+       sim := NewSimilarity()
+       posting := NewMatchPosting(sim)
+       posting.SetDocID(42)
+       if got := posting.GetDocID(); got != 42 {
+               t.Errorf("Set/GetDocID: %d", got)
+       }
+       posting.Reset()
+       if got := posting.getFreq(); got != 0 {
+               t.Errorf("getFreq: %d", got)
+       }
+}

Reply via email to