func (S) TestDiscard(c *C) { p := pipe.Line( pipe.Print("hello"), pipe.Discard(), pipe.Print("world"), ) output, err := pipe.Output(p) c.Assert(err, IsNil) c.Assert(string(output), Equals, "world") }
func (S) TestScriptPreservesStreams(c *C) { p := pipe.Script( pipe.Line( pipe.Print("hello\n"), pipe.Discard(), ), pipe.Exec("echo", "world"), ) output, err := pipe.Output(p) c.Assert(err, IsNil) c.Assert(string(output), Equals, "world\n") }