MCPcopy
hub / github.com/expr-lang/expr / labeledOutput

Function labeledOutput

internal/testify/assert/assertions.go:386–398  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

384//
385// 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.
386func labeledOutput(content ...labeledContent) string {
387 longestLabel := 0
388 for _, v := range content {
389 if len(v.label) > longestLabel {
390 longestLabel = len(v.label)
391 }
392 }
393 var output string
394 for _, v := range content {
395 output += "\t" + v.label + ":" + strings.Repeat(" ", longestLabel-len(v.label)) + "\t" + indentMessageLines(v.content, longestLabel) + "\n"
396 }
397 return output
398}
399
400// Implements asserts that an object is implemented by the specified interface.
401//

Callers 1

FailFunction · 0.85

Calls 1

indentMessageLinesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…