From 214e1dca024fb6da5ed65564d2de734df5dc2127 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Fri, 23 Oct 2015 12:05:02 +0200 Subject: format/pktline: review and improving coverage --- pktline/encoder_test.go | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 pktline/encoder_test.go (limited to 'pktline/encoder_test.go') diff --git a/pktline/encoder_test.go b/pktline/encoder_test.go deleted file mode 100644 index 091ad1c..0000000 --- a/pktline/encoder_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package pktline - -import ( - "io/ioutil" - - . "gopkg.in/check.v1" -) - -type EncoderSuite struct{} - -var _ = Suite(&EncoderSuite{}) - -func (s *EncoderSuite) TestEncode(c *C) { - line, err := Encode([]byte("a\n")) - c.Assert(err, IsNil) - c.Assert(string(line), Equals, "0006a\n") -} - -func (s *EncoderSuite) TestEncodeFromString(c *C) { - line, err := EncodeFromString("a\n") - c.Assert(err, IsNil) - c.Assert(string(line), Equals, "0006a\n") -} - -func (s *EncoderSuite) TestEncoder(c *C) { - e := NewEncoder() - e.AddLine("a") - e.AddFlush() - e.AddLine("b") - - r := e.GetReader() - a, _ := ioutil.ReadAll(r) - c.Assert(string(a), Equals, "0006a\n00000006b\n") -} -- cgit