MCPcopy Create free account
hub / github.com/go-task/task / PPSortedLines

Function PPSortedLines

task_test.go:305–310  ·  view source on GitHub ↗

PPSortedLines sorts the lines of the output of the task. This is useful when the order of the output is not important, but the output is expected to be the same each time the task is run (e.g. when running tasks in parallel).

(t *testing.T, b []byte)

Source from the content-addressed store, hash-verified

303// the order of the output is not important, but the output is expected to be
304// the same each time the task is run (e.g. when running tasks in parallel).
305func PPSortedLines(t *testing.T, b []byte) []byte {
306 t.Helper()
307 lines := strings.Split(strings.TrimSpace(string(b)), "\n")
308 sort.Strings(lines)
309 return []byte(strings.Join(lines, "\n") + "\n")
310}
311
312// normalizeOutput normalizes cross-platform differences for byte slice comparison:
313// - Converts CRLF and CR to LF (line endings)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…