mirror of https://github.com/stretchr/testify.git
parent
5c861cc4a4
commit
09f61d78b8
|
@ -189,7 +189,7 @@ func indentMessageLines(message string, longestLabelLen int) string {
|
|||
// no need to align first line because it starts at the correct location (after the label)
|
||||
if i != 0 {
|
||||
// append alignLen+1 spaces to align with "{{longestLabel}}:" before adding tab
|
||||
outBuf.WriteString("\n\r\t" + strings.Repeat(" ", longestLabelLen +1) + "\t")
|
||||
outBuf.WriteString("\n\r\t" + strings.Repeat(" ", longestLabelLen+1) + "\t")
|
||||
}
|
||||
outBuf.WriteString(scanner.Text())
|
||||
}
|
||||
|
@ -231,13 +231,13 @@ func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) bool {
|
|||
content = append(content, labeledContent{"Messages", message})
|
||||
}
|
||||
|
||||
t.Errorf("\r" + getWhitespaceString() + labeledOutput(content...))
|
||||
t.Errorf("%s", "\r"+getWhitespaceString()+labeledOutput(content...))
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
type labeledContent struct {
|
||||
label string
|
||||
label string
|
||||
content string
|
||||
}
|
||||
|
||||
|
|
|
@ -630,7 +630,7 @@ func TestNoError(t *testing.T) {
|
|||
}()
|
||||
|
||||
if err == nil { // err is not nil here!
|
||||
t.Errorf("Error should be nil due to empty interface", err)
|
||||
t.Error("Error should be nil due to empty interface", err)
|
||||
}
|
||||
|
||||
False(t, NoError(mockT, err), "NoError should fail with empty error interface")
|
||||
|
@ -664,7 +664,7 @@ func TestError(t *testing.T) {
|
|||
}()
|
||||
|
||||
if err == nil { // err is not nil here!
|
||||
t.Errorf("Error should be nil due to empty interface", err)
|
||||
t.Error("Error should be nil due to empty interface", err)
|
||||
}
|
||||
|
||||
True(t, Error(mockT, err), "Error should pass with empty error interface")
|
||||
|
|
Loading…
Reference in New Issue