wcLineCount parses the leading integer from a `wc -l ` stdout, whose shape is " ". Fails the test if the output cannot be parsed.
(t *testing.T, stdout string)
| 27 | // wcLineCount parses the leading integer from a `wc -l <file>` stdout, whose |
| 28 | // shape is "<count> <filename>". Fails the test if the output cannot be parsed. |
| 29 | func wcLineCount(t *testing.T, stdout string) int { |
| 30 | t.Helper() |
| 31 | fields := strings.Fields(stdout) |
| 32 | assert.Assert(t, len(fields) > 0, "expected wc -l output, got: %q", stdout) |
| 33 | n, err := strconv.Atoi(fields[0]) |
| 34 | assert.NilError(t, err, "expected leading integer in wc -l output, got: %q", stdout) |
| 35 | return n |
| 36 | } |
| 37 | |
| 38 | func TestPostStartHookInError(t *testing.T) { |
| 39 | c := NewParallelCLI(t) |
no outgoing calls
no test coverage detected