MCPcopy Index your code
hub / github.com/foxcpp/maddy / ExpectPattern

Method ExpectPattern

tests/conn.go:130–147  ·  view source on GitHub ↗

ExpectPattern reads a line from the connection socket and checks whether is matches the supplied shell pattern (as defined by path.Match). The original line is returned.

(pat string)

Source from the content-addressed store, hash-verified

128// matches the supplied shell pattern (as defined by path.Match). The original
129// line is returned.
130func (c *Conn) ExpectPattern(pat string) string {
131 c.T.Helper()
132
133 line, err := c.Readln()
134 if err != nil {
135 c.T.Fatal("Unexpected I/O error:", err)
136 }
137
138 match, err := path.Match(pat, line)
139 if err != nil {
140 c.T.Fatal("Malformed pattern:", err)
141 }
142 if !match {
143 c.T.Fatalf("Response line not matching the expected pattern, want %q", pat)
144 }
145
146 return line
147}
148
149func (c *Conn) fatal(f string, args ...interface{}) {
150 c.T.Helper()

Callers 15

SMTPPlainAuthMethod · 0.95
SMTPNegotationMethod · 0.95
TestConcurrencyLimitFunction · 0.80
TestPerIPConcurrencyFunction · 0.80
TestImapsqlDeliveryFunction · 0.80
TestImapsqlDeliveryMapFunction · 0.80
TestImapsqlAuthMapFunction · 0.80
TestLMTPClient_Issue308Function · 0.80
TestDovecotSASLClientFunction · 0.80

Calls 1

ReadlnMethod · 0.95

Tested by 15

TestConcurrencyLimitFunction · 0.64
TestPerIPConcurrencyFunction · 0.64
TestImapsqlDeliveryFunction · 0.64
TestImapsqlDeliveryMapFunction · 0.64
TestImapsqlAuthMapFunction · 0.64
TestLMTPClient_Issue308Function · 0.64
TestDovecotSASLClientFunction · 0.64