Converting package back to stanza.

This commit is contained in:
Andrey Smirnov
2013-12-24 01:17:05 +04:00
parent 2e44d23e4d
commit e37bcf2ea0
3 changed files with 55 additions and 8 deletions
+5 -1
View File
@@ -4,6 +4,7 @@ import (
"bufio"
"bytes"
. "launchpad.net/gocheck"
"strings"
)
type ControlFileSuite struct {
@@ -110,11 +111,14 @@ func (s *ControlFileSuite) TestReadWriteStanza(c *C) {
err = w.Flush()
c.Assert(err, IsNil)
r = NewControlFileReader(bytes.NewBuffer(buf.Bytes()))
str := buf.String()
r = NewControlFileReader(buf)
stanza2, err := r.ReadStanza()
c.Assert(err, IsNil)
c.Assert(stanza2, DeepEquals, stanza)
c.Assert(strings.HasPrefix(str, "Package: "), Equals, true)
}
func (s *ControlFileSuite) BenchmarkReadStanza(c *C) {