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 <[email protected]> Authored: Mon Nov 16 18:16:28 2015 -0800 Committer: Marvin Humphrey <[email protected]> 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")
