MCPcopy Create free account
hub / github.com/go-git/go-git / TestEncodef

Method TestEncodef

plumbing/format/pktline/encoder_test.go:199–212  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

197}
198
199func (s *SuiteEncoder) TestEncodef(c *C) {
200 format := " %s %d\n"
201 str := "foo"
202 d := 42
203
204 var buf bytes.Buffer
205 e := pktline.NewEncoder(&buf)
206
207 err := e.Encodef(format, str, d)
208 c.Assert(err, IsNil)
209
210 expected := []byte("000c foo 42\n")
211 c.Assert(buf.Bytes(), DeepEquals, expected)
212}

Callers

nothing calls this directly

Calls 3

EncodefMethod · 0.95
NewEncoderFunction · 0.92
BytesMethod · 0.45

Tested by

no test coverage detected