MCPcopy
hub / github.com/awnumar/memguard / TestStreamSize

Function TestStreamSize

stream_test.go:203–217  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

201}
202
203func TestStreamSize(t *testing.T) {
204 s := NewStream()
205
206 if s.Size() != 0 {
207 t.Error("size is", s.Size())
208 }
209
210 size := 1024 * 32
211 b := make([]byte, size)
212 write(t, s, b)
213
214 if s.Size() != size {
215 t.Error("size should be", size, "instead is", s.Size())
216 }
217}
218
219func BenchmarkStreamWrite(b *testing.B) {
220 b.ReportAllocs()

Callers

nothing calls this directly

Calls 3

SizeMethod · 0.95
NewStreamFunction · 0.85
writeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…