MCPcopy Index your code
hub / github.com/coder/coder / ReadUntilString

Method ReadUntilString

testutil/pty.go:33–37  ·  view source on GitHub ↗

ReadUntilString emulates a terminal and reads one byte at a time until we either see the string we want, or the context expires. The PTY must be sized to 80x80 or there could be unexpected results.

(ctx context.Context, want string)

Source from the content-addressed store, hash-verified

31// either see the string we want, or the context expires. The PTY must be sized
32// to 80x80 or there could be unexpected results.
33func (tr *TerminalReader) ReadUntilString(ctx context.Context, want string) error {
34 return tr.ReadUntil(ctx, func(line string) bool {
35 return strings.TrimSpace(line) == want
36 })
37}
38
39// ReadUntil emulates a terminal and reads one byte at a time until the matcher
40// returns true or the context expires. If the matcher is nil, read until EOF.

Callers 3

Test_Start_truncationFunction · 0.95
Test_RunnerFunction · 0.95

Calls 1

ReadUntilMethod · 0.95

Tested by 3

Test_Start_truncationFunction · 0.76
Test_RunnerFunction · 0.76