Skip to content

Commit

Permalink
Merge #11820
Browse files Browse the repository at this point in the history
11820: backend/display/test: string(buffer.Bytes()) => buffer.String() r=abhinav a=abhinav

`bytes.Buffer` has a `String()` method
that is equivalent to `string(b.Bytes())`.


Co-authored-by: Abhinav Gupta <abhinav@pulumi.com>
  • Loading branch information
bors[bot] and abhinav committed Jan 11, 2023
2 parents 15141d5 + 643ed01 commit 351ee2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/backend/display/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ func testDiffEvents(t *testing.T, path string, accept bool, truncateOutput bool)
<-doneChannel

if !accept {
assert.Equal(t, string(expectedStdout), string(stdout.Bytes()))
assert.Equal(t, string(expectedStderr), string(stderr.Bytes()))
assert.Equal(t, string(expectedStdout), stdout.String())
assert.Equal(t, string(expectedStderr), stderr.String())
} else {
err = os.WriteFile(path+".stdout.txt", stdout.Bytes(), 0600)
require.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions pkg/backend/display/progress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ func testProgressEvents(t *testing.T, path string, accept, interactive bool, wid
<-doneChannel

if !accept {
assert.Equal(t, string(expectedStdout), string(stdout.Bytes()))
assert.Equal(t, string(expectedStderr), string(stderr.Bytes()))
assert.Equal(t, string(expectedStdout), stdout.String())
assert.Equal(t, string(expectedStderr), stderr.String())
} else {
err = os.WriteFile(path+suffix+".stdout.txt", stdout.Bytes(), 0600)
require.NoError(t, err)
Expand Down

0 comments on commit 351ee2b

Please sign in to comment.