blob: ab6a1e61e3ed46ce6764b0cfe38797b3b43e9b89 (
plain) (
tree)
|
|
package packp
import (
"bytes"
"io"
"testing"
"srcd.works/go-git.v4/plumbing/format/pktline"
. "gopkg.in/check.v1"
)
func Test(t *testing.T) { TestingT(t) }
// returns a byte slice with the pkt-lines for the given payloads.
func pktlines(c *C, payloads ...string) []byte {
var buf bytes.Buffer
e := pktline.NewEncoder(&buf)
err := e.EncodeString(payloads...)
c.Assert(err, IsNil, Commentf("building pktlines for %v\n", payloads))
return buf.Bytes()
}
func toPktLines(c *C, payloads []string) io.Reader {
var buf bytes.Buffer
e := pktline.NewEncoder(&buf)
err := e.EncodeString(payloads...)
c.Assert(err, IsNil)
return &buf
}
|