MCPcopy Create free account
hub / github.com/djherbis/buffer / TestPartitionAt

Function TestPartitionAt

buffer_test.go:852–863  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

850}
851
852func TestPartitionAt(t *testing.T) {
853 buf := NewPartitionAt(NewMemPoolAt(5))
854 buf.Write([]byte("Hello World"))
855 data := make([]byte, 12)
856 n, _ := buf.Read(data)
857 if !bytes.Equal(data[:n], []byte("Hello World")) {
858 t.Error("Read Failed. " + string(data[:n]))
859 }
860
861 checkCap(t, buf, math.MaxInt64)
862 runPerfectSeries(t, buf)
863}
864
865// TestPartitionAt2 tests ability to read at various offsets from buffer previously written.
866func TestPartitionAt2(t *testing.T) {

Callers

nothing calls this directly

Calls 6

NewPartitionAtFunction · 0.85
NewMemPoolAtFunction · 0.85
checkCapFunction · 0.85
runPerfectSeriesFunction · 0.85
WriteMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…