Skip to content

Commit ce4b752

Browse files
committed
cli/command: TestNewDockerCliAndOperators fix unhandled errors
Assert that the write succeeded; also changing `Fprintf` to `Fprint`, because we were not using templating (we should check why no linter complained about this). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent f66c5a3 commit ce4b752

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

cli/command/cli_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,14 @@ func TestNewDockerCliAndOperators(t *testing.T) {
280280
assert.NilError(t, err)
281281
assert.Equal(t, string(inputStream), "input")
282282
// Check output stream
283-
fmt.Fprintf(cli.Out(), "output")
283+
_, err = fmt.Fprint(cli.Out(), "output")
284+
assert.NilError(t, err)
284285
outputStream, err := io.ReadAll(outbuf)
285286
assert.NilError(t, err)
286287
assert.Equal(t, string(outputStream), "output")
287288
// Check error stream
288-
fmt.Fprintf(cli.Err(), "error")
289+
_, err = fmt.Fprint(cli.Err(), "error")
290+
assert.NilError(t, err)
289291
errStream, err := io.ReadAll(errbuf)
290292
assert.NilError(t, err)
291293
assert.Equal(t, string(errStream), "error")

0 commit comments

Comments
 (0)