You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2015/12/28 21:10:50 UTC

[03/16] lucy git commit: Test Go bindings for Posting.

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 <ma...@rectangular.com>
Authored: Thu Dec 3 19:13:19 2015 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
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)
+	}
+}