MCPcopy Create free account
hub / github.com/commander-cli/commander / printFailures

Method printFailures

pkg/output/cli.go:97–119  ·  view source on GitHub ↗
(results []runtime.TestResult)

Source from the content-addressed store, hash-verified

95}
96
97func (w *OutputWriter) printFailures(results []runtime.TestResult) {
98 w.fprintf("")
99 w.fprintf(w.au.Bold("Results"))
100 w.fprintf(w.au.Bold(""))
101
102 for _, tr := range results {
103 r := convertTestResult(tr)
104 if r.Skipped {
105 continue
106 }
107
108 if r.Error != nil {
109 w.fprintf(w.au.Bold(w.au.Red(w.template.errors(r))))
110 w.fprintf(r.Error.Error())
111 continue
112 }
113
114 if !r.Success {
115 w.fprintf(w.au.Bold(w.au.Red(w.template.failures(r))))
116 w.fprintf(r.Diff)
117 }
118 }
119}
120
121func (w *OutputWriter) fprintf(a ...interface{}) {
122 if _, err := fmt.Fprintln(w.out, a...); err != nil {

Callers 1

PrintSummaryMethod · 0.95

Calls 4

fprintfMethod · 0.95
convertTestResultFunction · 0.85
errorsMethod · 0.80
failuresMethod · 0.80

Tested by

no test coverage detected