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

Function TestBytesOutputsInputBytesUnchanged

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

Source from the content-addressed store, hash-verified

1513}
1514
1515func TestBytesOutputsInputBytesUnchanged(t *testing.T) {
1516 t.Parallel()
1517 want := []byte{8, 0, 0, 16}
1518 input := bytes.NewReader(want)
1519 got, err := script.NewPipe().WithReader(input).Bytes()
1520 if err != nil {
1521 t.Fatal(err)
1522 }
1523 if !cmp.Equal(want, got) {
1524 t.Error(cmp.Diff(want, got))
1525 }
1526}
1527
1528func TestBytesReturnsErrorGivenReadErrorOnPipe(t *testing.T) {
1529 t.Parallel()

Callers

nothing calls this directly

Calls 4

NewPipeFunction · 0.92
BytesMethod · 0.80
WithReaderMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…