Exemplo n.º 1
0
func (s *SSHStreamSuite) TestStripCROneByte(c *gc.C) {
	reader := ssh.StripCRReader(strings.NewReader("One\r\r\rTwo"))
	output, err := ioutil.ReadAll(iotest.OneByteReader(reader))
	c.Assert(err, jc.ErrorIsNil)
	c.Check(string(output), gc.Equals, "OneTwo")
}
Exemplo n.º 2
0
func (s *SSHStreamSuite) TestStripCRError(c *gc.C) {
	reader := ssh.StripCRReader(strings.NewReader("One\r\r\rTwo"))
	_, err := ioutil.ReadAll(iotest.TimeoutReader(reader))
	c.Assert(err.Error(), gc.Equals, "timeout")
}
Exemplo n.º 3
0
func (s *SSHStreamSuite) TestNewStripCRNil(c *gc.C) {
	reader := ssh.StripCRReader(nil)
	c.Assert(reader, gc.IsNil)
}