From 1b28f6218ba649b4a8d99b6ad3a444ea541a7e89 Mon Sep 17 00:00:00 2001 From: Marty Schoch Date: Mon, 13 Jul 2015 15:22:54 -0400 Subject: [PATCH] additional row validation --- index/upside_down/reader_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/index/upside_down/reader_test.go b/index/upside_down/reader_test.go index a27b6e2b..c9e44556 100644 --- a/index/upside_down/reader_test.go +++ b/index/upside_down/reader_test.go @@ -295,3 +295,13 @@ func TestIndexDocIdReader(t *testing.T) { t.Errorf("expected to find id '', got '%s'", id) } } + +func TestCrashBadBackIndexRow(t *testing.T) { + br, err := NewBackIndexRowKV([]byte{byte('b'), byte('a'), ByteSeparator}, []byte{}) + if err != nil { + t.Fatal(err) + } + if string(br.doc) != "a" { + t.Fatal(err) + } +}