diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2015-10-23 12:05:02 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2015-10-23 12:05:02 +0200 |
commit | 214e1dca024fb6da5ed65564d2de734df5dc2127 (patch) | |
tree | 0c2805a0676006690a8053ae8ccee388ccfc83fe /pktline/encoder_test.go | |
parent | 70923099e61fa33f0bc5256d2f938fa44c4df10e (diff) | |
download | go-git-214e1dca024fb6da5ed65564d2de734df5dc2127.tar.gz |
format/pktline: review and improving coverage
Diffstat (limited to 'pktline/encoder_test.go')
-rw-r--r-- | pktline/encoder_test.go | 34 |
1 files changed, 0 insertions, 34 deletions
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") -} |