MCPcopy
hub / github.com/cli/cli / Test

Function Test

pkg/iostreams/iostreams.go:551–568  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

549}
550
551func Test() (*IOStreams, *bytes.Buffer, *bytes.Buffer, *bytes.Buffer) {
552 in := &bytes.Buffer{}
553 out := &bytes.Buffer{}
554 errOut := &bytes.Buffer{}
555 io := &IOStreams{
556 In: &fdReader{
557 fd: 0,
558 ReadCloser: io.NopCloser(in),
559 },
560 Out: &fdWriter{fd: 1, Writer: out},
561 ErrOut: &fdWriter{fd: 2, Writer: errOut},
562 term: &fakeTerm{},
563 }
564 io.SetStdinTTY(false)
565 io.SetStdoutTTY(false)
566 io.SetStderrTTY(false)
567 return io, in, out, errOut
568}
569
570func isTerminal(f *os.File) bool {
571 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 3

SetStdinTTYMethod · 0.95
SetStdoutTTYMethod · 0.95
SetStderrTTYMethod · 0.95

Tested by

no test coverage detected