(c *C)
| 93 | } |
| 94 | |
| 95 | func (s *CommonSuite) TestNewContextWriter(c *C) { |
| 96 | buf := bytes.NewBuffer(nil) |
| 97 | ctx, close := context.WithCancel(context.Background()) |
| 98 | |
| 99 | r := NewContextWriter(ctx, buf) |
| 100 | |
| 101 | n, err := r.Write([]byte("1")) |
| 102 | c.Assert(n, Equals, 1) |
| 103 | c.Assert(err, IsNil) |
| 104 | |
| 105 | close() |
| 106 | n, err = r.Write([]byte("1")) |
| 107 | c.Assert(n, Equals, 0) |
| 108 | c.Assert(err, NotNil) |
| 109 | } |
| 110 | |
| 111 | func (s *CommonSuite) TestNewContextWriteCloser(c *C) { |
| 112 | buf := NewWriteCloser(bytes.NewBuffer(nil), &closer{}) |
nothing calls this directly
no test coverage detected