MCPcopy Index your code
hub / github.com/bitfield/script / TestExecForEach_SendsStderrOutputToPipeStderr

Function TestExecForEach_SendsStderrOutputToPipeStderr

script_test.go:339–352  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

337}
338
339func TestExecForEach_SendsStderrOutputToPipeStderr(t *testing.T) {
340 t.Parallel()
341 buf := new(bytes.Buffer)
342 out, err := script.Echo("go").WithStderr(buf).ExecForEach("{{.}}").String()
343 if err != nil {
344 t.Fatal(err)
345 }
346 if out != "" {
347 t.Fatalf("unexpected output: %q", out)
348 }
349 if !strings.Contains(buf.String(), "Usage") {
350 t.Errorf("want stderr output containing the word 'Usage', got %q", buf.String())
351 }
352}
353
354func TestExecSendsStderrOutputToPipeStderr(t *testing.T) {
355 t.Parallel()

Callers

nothing calls this directly

Calls 4

EchoFunction · 0.92
StringMethod · 0.80
ExecForEachMethod · 0.80
WithStderrMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…