labeledOutput returns a string consisting of the provided labeledContent. Each labeled output is appended in the following manner: \t{{label}}:{{align_spaces}}\t{{content}}\n The initial carriage return is required to undo/erase any padding added by testing.T.Errorf. The "\t{{label}}:" is for the
(content ...labeledContent)
| 404 | // |
| 405 | // If the content of the labeledOutput contains line breaks, the subsequent lines are aligned so that they start at the same location as the first line. |
| 406 | func labeledOutput(content ...labeledContent) string { |
| 407 | longestLabel := 0 |
| 408 | for _, v := range content { |
| 409 | if len(v.label) > longestLabel { |
| 410 | longestLabel = len(v.label) |
| 411 | } |
| 412 | } |
| 413 | var output string |
| 414 | for _, v := range content { |
| 415 | output += "\t" + v.label + ":" + strings.Repeat(" ", longestLabel-len(v.label)) + "\t" + indentMessageLines(v.content, longestLabel) + "\n" |
| 416 | } |
| 417 | return output |
| 418 | } |
| 419 | |
| 420 | // Implements asserts that an object is implemented by the specified interface. |
| 421 | // |
no test coverage detected