From 5aff27ac4dbebfc809d7b0b30cb3ba1433bc9e2b Mon Sep 17 00:00:00 2001 From: saxon Date: Tue, 29 Jan 2019 10:40:22 +1030 Subject: [PATCH] stream/mts/psi/descriptor_test.go: wrote test to check ProgramInfoLen func and descriptors func --- stream/mts/meta.go | 2 ++ stream/mts/meta_test.go | 1 + 2 files changed, 3 insertions(+) diff --git a/stream/mts/meta.go b/stream/mts/meta.go index c12998bd..465a537e 100644 --- a/stream/mts/meta.go +++ b/stream/mts/meta.go @@ -107,6 +107,8 @@ func (m *Meta) Delete(key string) error { return errKeyAbsent } +// Encode takes the meta data map and encods into a byte slice with header +// describing the version, length of data and data in TSV format. func (m *Meta) Encode() []byte { m.enc = m.enc[:headSize] diff --git a/stream/mts/meta_test.go b/stream/mts/meta_test.go index 010c9b82..daff9038 100644 --- a/stream/mts/meta_test.go +++ b/stream/mts/meta_test.go @@ -126,6 +126,7 @@ func TestDeleteAbsentKey(t *testing.T) { } } +// TestEncode checks that we're getting the correct byte slice from Meta.Encode(). func TestEncode(t *testing.T) { meta := NewMeta() meta.Add(tstKey1, tstData1)