MCPcopy Index your code
hub / github.com/google/gvisor / TestPullUpModifiedViews

Function TestPullUpModifiedViews

pkg/buffer/buffer_test.go:702–719  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

700}
701
702func TestPullUpModifiedViews(t *testing.T) {
703 var b Buffer
704 defer b.Release()
705 for _, s := range []string{"abcdef", "123456", "ghijkl"} {
706 v := NewViewWithData([]byte(s))
707 v.TrimFront(3)
708 b.appendOwned(v)
709 }
710
711 v, ok := b.PullUp(3, 3)
712 if !ok {
713 t.Errorf("PullUp failed: want ok=true, got ok=false")
714 }
715 want := []byte("456")
716 if !bytes.Equal(v.AsSlice(), want) {
717 t.Errorf("PullUp failed: want %v, got %v", want, v.AsSlice())
718 }
719}
720
721func TestBufferClone(t *testing.T) {
722 const (

Callers

nothing calls this directly

Calls 8

ReleaseMethod · 0.95
appendOwnedMethod · 0.95
PullUpMethod · 0.95
NewViewWithDataFunction · 0.85
ErrorfMethod · 0.65
TrimFrontMethod · 0.45
EqualMethod · 0.45
AsSliceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…