MCPcopy
hub / github.com/bitfield/script / TestWithStdout_SetsSpecifiedWriterAsStdout

Function TestWithStdout_SetsSpecifiedWriterAsStdout

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

Source from the content-addressed store, hash-verified

1813}
1814
1815func TestWithStdout_SetsSpecifiedWriterAsStdout(t *testing.T) {
1816 t.Parallel()
1817 buf := new(bytes.Buffer)
1818 want := "Hello, world."
1819 _, err := script.Echo(want).WithStdout(buf).Stdout()
1820 if err != nil {
1821 t.Fatal(err)
1822 }
1823 got := buf.String()
1824 if got != want {
1825 t.Errorf("want %q, got %q", want, got)
1826 }
1827}
1828
1829func TestWithEnv_UnsetsAllEnvVarsGivenEmptySlice(t *testing.T) {
1830 t.Parallel()

Callers

nothing calls this directly

Calls 4

EchoFunction · 0.92
StdoutMethod · 0.80
WithStdoutMethod · 0.80
StringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…