Skip to content

Commit

Permalink
assert: indentMessageLines - build message with bytes instead of string
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunmahishi committed Mar 7, 2024
1 parent 6b0dfad commit 594ac7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion assert/assertions.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ func indentMessageLines(message string, longestLabelLen int) string {
outBuf.WriteString("\n\t" + strings.Repeat(" ", longestLabelLen+1) + "\t")
}

outBuf.WriteString(msgScanner.Text())
outBuf.Write(msgScanner.Bytes())
first = false
}

Expand Down
9 changes: 2 additions & 7 deletions assert/assertions_priv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@ import (
"testing"
)

const (
// set maxScanTokenSize to 1 more than the default set by bufio. This will
// cover the case where a single line is longer than the default
// maxScanTokenSize
maxScanTokenSize = bufio.MaxScanTokenSize + 1
)

func Test_indentMessageLines(t *testing.T) {
const maxScanTokenSize = bufio.MaxScanTokenSize + 1

tt := []struct {
name string
msg string
Expand Down

0 comments on commit 594ac7d

Please sign in to comment.