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

Function TestFilterByCopyToDiscardGivesNoOutput

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

Source from the content-addressed store, hash-verified

402}
403
404func TestFilterByCopyToDiscardGivesNoOutput(t *testing.T) {
405 t.Parallel()
406 p := script.Echo("hello").Filter(func(r io.Reader, w io.Writer) error {
407 _, err := io.Copy(io.Discard, r)
408 return err
409 })
410 want := ""
411 got, err := p.String()
412 if err != nil {
413 t.Fatal(err)
414 }
415 if want != got {
416 t.Error(cmp.Diff(want, got))
417 }
418}
419
420func TestFilterReadsNoMoreThanRequested(t *testing.T) {
421 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…