MCPcopy Create free account
hub / github.com/cli/cli / Test

Function Test

pkg/iostreams/iostreams.go:586–605  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

584}
585
586func Test() (*IOStreams, *bytes.Buffer, *bytes.Buffer, *bytes.Buffer) {
587 in := &bytes.Buffer{}
588 out := &bytes.Buffer{}
589 errOut := &bytes.Buffer{}
590 io := &IOStreams{
591 In: &fdReader{
592 fd: 0,
593 ReadCloser: io.NopCloser(in),
594 },
595 Out: &fdWriter{fd: 1, Writer: out},
596 ErrOut: &fdWriter{fd: 2, Writer: errOut},
597 term: &fakeTerm{},
598 sanitizeContent: true,
599 }
600 io.ContentOut = newContentWriter(io.Out, io.sanitizeContent)
601 io.SetStdinTTY(false)
602 io.SetStdoutTTY(false)
603 io.SetStderrTTY(false)
604 return io, in, out, errOut
605}
606
607func isTerminal(f *os.File) bool {
608 return ghTerm.IsTerminal(f) || isCygwinTerminal(f.Fd())

Callers 15

Test_exportFormat_WriteFunction · 0.92
TestDeleteRunFunction · 0.92
TestListRunFunction · 0.92
TestNewCmdCompletionFunction · 0.92
TestNewCmdViewFunction · 0.92
TestViewRunFunction · 0.92
TestNewCmdListFunction · 0.92
TestListRunFunction · 0.92
TestNewCmdCommentFunction · 0.92
TestCommentRunFunction · 0.92
TestNewCmdCreateFunction · 0.92
TestCreateRunFunction · 0.92

Calls 4

SetStdinTTYMethod · 0.95
SetStdoutTTYMethod · 0.95
SetStderrTTYMethod · 0.95
newContentWriterFunction · 0.85

Tested by

no test coverage detected