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

Method TestEncoderWriteError

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

Source from the content-addressed store, hash-verified

533}
534
535func (s *S) TestEncoderWriteError(c *C) {
536 enc := yaml.NewEncoder(errorWriter{})
537 err := enc.Encode(map[string]string{"a": "b"})
538 c.Assert(err, ErrorMatches, `yaml: write error: some write error`) // Data not flushed yet
539}
540
541type errorWriter struct{}
542

Callers

nothing calls this directly

Calls 1

EncodeMethod · 0.95

Tested by

no test coverage detected