diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2021-03-20 09:17:20 -0400 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2021-03-20 09:17:20 -0400 |
| commit | c17a496567eb1824937726a50f73ddeeb0b5a520 (patch) | |
| tree | b08bb7ff3438db795f01eab6a22799e54c143271 /internal/tests/integration/basic_test.go | |
| parent | efca627b22d28dc58b295482c9e052ebba2f0c2b (diff) | |
Stop printing newline on stderr when outputting to stdout
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'internal/tests/integration/basic_test.go')
| -rw-r--r-- | internal/tests/integration/basic_test.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/internal/tests/integration/basic_test.go b/internal/tests/integration/basic_test.go index 408ddce5..4f39058f 100644 --- a/internal/tests/integration/basic_test.go +++ b/internal/tests/integration/basic_test.go @@ -45,7 +45,7 @@ func (s *BasicSuite) TestTakesStdinByDefault(c *C) { cmd.Stdin = bytes.NewBufferString("hello world") }) result.Assert(c, icmd.Expected{ExitCode: 0, Out: "hello world"}) - assert.Equal(c, "hello world\n", result.Combined()) + assert.Equal(c, "hello world", result.Combined()) } func (s *BasicSuite) TestTakesStdinWithFileFlag(c *C) { @@ -53,15 +53,14 @@ func (s *BasicSuite) TestTakesStdinWithFileFlag(c *C) { cmd.Stdin = bytes.NewBufferString("hello world") }) result.Assert(c, icmd.Expected{ExitCode: 0, Out: "hello world"}) - assert.Equal(c, "hello world\n", result.Combined()) + assert.Equal(c, "hello world", result.Combined()) } func (s *BasicSuite) TestWritesToStdoutWithOutFlag(c *C) { result := icmd.RunCmd(icmd.Command(GomplateBin, "--out", "-"), func(cmd *icmd.Cmd) { cmd.Stdin = bytes.NewBufferString("hello world") }) assert.Equal(c, 0, result.ExitCode) - assert.Equal(c, "hello world", result.Stdout()) - assert.Equal(c, "\n", result.Stderr()) + assert.Equal(c, "hello world", result.Combined()) } func (s *BasicSuite) TestIgnoresStdinWithInFlag(c *C) { @@ -69,7 +68,7 @@ func (s *BasicSuite) TestIgnoresStdinWithInFlag(c *C) { cmd.Stdin = bytes.NewBufferString("hello world") }) result.Assert(c, icmd.Expected{ExitCode: 0, Out: "hi"}) - assert.Equal(c, "hi\n", result.Combined()) + assert.Equal(c, "hi", result.Combined()) } func (s *BasicSuite) TestErrorsWithInputOutputImbalance(c *C) { |
