MCPcopy Create free account
hub / github.com/GoTestTools/gotestfmt / Write

Method Write

parser/parse.go:317–341  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

315}
316
317func (p *packageTracker) Write() {
318 sort.SliceStable(
319 p.packages, func(i, j int) bool {
320 return p.packages[i].Name < p.packages[j].Name
321 },
322 )
323 for _, pkg := range p.packages {
324 pkg.Output = strings.TrimRight(pkg.Output, "\n")
325 pkg.Reason = strings.TrimRight(pkg.Reason, "\n")
326 sort.SliceStable(
327 pkg.TestCases, func(i, j int) bool {
328 return compareTestCaseNames(pkg.TestCases[i].Name, pkg.TestCases[j].Name)
329 },
330 )
331 for _, tc := range pkg.TestCases {
332 tc.Output = strings.TrimRight(tc.Output, "\n")
333 if tc.Result == "" {
334 tc.Result = ResultFail
335 }
336 }
337 }
338 for _, pkg := range p.packages {
339 p.target <- pkg
340 }
341}
342
343func compareTestCaseNames(name1 string, name2 string) bool {
344 parts1 := strings.SplitN(name1, "/", -1)

Callers 2

parseFunction · 0.95

Calls 1

compareTestCaseNamesFunction · 0.85

Tested by

no test coverage detected