MCPcopy
hub / github.com/go-yaml/yaml / TestEncoderSingleDocument

Method TestEncoderSingleDocument

encode_test.go:510–521  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

508}
509
510func (s *S) TestEncoderSingleDocument(c *C) {
511 for i, item := range marshalTests {
512 c.Logf("test %d. %q", i, item.data)
513 var buf bytes.Buffer
514 enc := yaml.NewEncoder(&buf)
515 err := enc.Encode(item.value)
516 c.Assert(err, Equals, nil)
517 err = enc.Close()
518 c.Assert(err, Equals, nil)
519 c.Assert(buf.String(), Equals, item.data)
520 }
521}
522
523func (s *S) TestEncoderMultipleDocuments(c *C) {
524 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 3

EncodeMethod · 0.95
CloseMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected