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

Function TestFilterByCopyPassesInputThroughUnchanged

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

Source from the content-addressed store, hash-verified

367}
368
369func TestFilterByCopyPassesInputThroughUnchanged(t *testing.T) {
370 t.Parallel()
371 p := script.Echo("hello").Filter(func(r io.Reader, w io.Writer) error {
372 _, err := io.Copy(w, r)
373 return err
374 })
375 want := "hello"
376 got, err := p.String()
377 if err != nil {
378 t.Fatal(err)
379 }
380 if want != got {
381 t.Error(cmp.Diff(want, got))
382 }
383}
384
385func TestFilterCanChainFilters(t *testing.T) {
386 t.Parallel()

Callers

nothing calls this directly

Calls 4

EchoFunction · 0.92
FilterMethod · 0.80
StringMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…