lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [10/13] lucy git commit: Test Go bindings for HitDoc.
Date Tue, 24 Nov 2015 23:38:32 GMT
Test Go bindings for HitDoc.


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

Branch: refs/heads/master
Commit: 66120820174ffd6bc2459179fe642d094cc3ad57
Parents: 91dd389
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Mon Nov 16 18:16:28 2015 -0800
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Fri Nov 20 19:00:31 2015 -0800

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


http://git-wip-us.apache.org/repos/asf/lucy/blob/66120820/go/lucy/document_test.go
----------------------------------------------------------------------
diff --git a/go/lucy/document_test.go b/go/lucy/document_test.go
index 2cf6313..4a82baa 100644
--- a/go/lucy/document_test.go
+++ b/go/lucy/document_test.go
@@ -49,6 +49,19 @@ func TestDocMisc(t *testing.T) {
 	checkdocDumpLoad(t, doc)
 }
 
+func TestHitDocMisc(t *testing.T) {
+	hitDoc := NewHitDoc(42, 1.5)
+	if got := hitDoc.GetScore(); got != 1.5 {
+		t.Errorf("GetScore: %f", got)
+	}
+	hitDoc.SetScore(2.0)
+	if got := hitDoc.GetScore(); got != 2.0 {
+		t.Errorf("Set/GetScore: %f", got)
+	}
+	checkDocSerialize(t, hitDoc)
+	checkdocDumpLoad(t, hitDoc)
+}
+
 func checkDocSerialize(t *testing.T, doc Doc) {
 	folder := NewRAMFolder("")
 	outStream, _ := folder.OpenOut("foo")


Mime
View raw message