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

Function Test

pkg/iostreams/iostreams.go:585–604  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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