(t *testing.T)
| 89 | } |
| 90 | |
| 91 | func TestStderr(t *testing.T) { |
| 92 | t.Parallel() |
| 93 | testBytes := []byte("Hello world\n") |
| 94 | session, _, cleanup := newTestSession(t, &Server{ |
| 95 | Handler: func(s Session) { |
| 96 | s.Stderr().Write(testBytes) |
| 97 | }, |
| 98 | }, nil) |
| 99 | defer cleanup() |
| 100 | var stderr bytes.Buffer |
| 101 | session.Stderr = &stderr |
| 102 | if err := session.Run(""); err != nil { |
| 103 | t.Fatal(err) |
| 104 | } |
| 105 | if !bytes.Equal(stderr.Bytes(), testBytes) { |
| 106 | t.Fatalf("stderr = %#v; want %#v", stderr.Bytes(), testBytes) |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | func TestStdin(t *testing.T) { |
| 111 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…