MCPcopy Create free account
hub / github.com/foxcpp/maddy / BodyFromStr

Function BodyFromStr

internal/testutils/buffer.go:32–46  ·  view source on GitHub ↗
(t *testing.T, literal string)

Source from the content-addressed store, hash-verified

30)
31
32func BodyFromStr(t *testing.T, literal string) (textproto.Header, buffer.MemoryBuffer) {
33 t.Helper()
34
35 bufr := bufio.NewReader(strings.NewReader(literal))
36 hdr, err := textproto.ReadHeader(bufr)
37 if err != nil {
38 t.Fatal(err)
39 }
40 body, err := io.ReadAll(bufr)
41 if err != nil {
42 t.Fatal(err)
43 }
44
45 return hdr, buffer.MemoryBuffer{Slice: body}
46}
47
48type errorReader struct {
49 r io.Reader

Callers 7

TestDkimVerify_NoSigFunction · 0.92
TestDkimVerify_ValidSigFunction · 0.92
TestDkimVerify_FailOpenFunction · 0.92

Calls

no outgoing calls

Tested by 7

TestDkimVerify_NoSigFunction · 0.74
TestDkimVerify_ValidSigFunction · 0.74
TestDkimVerify_FailOpenFunction · 0.74