MCPcopy Index your code
hub / github.com/docker/docker-agent / TestBuffer_Bytes

Function TestBuffer_Bytes

pkg/concurrent/buffer_test.go:27–38  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25}
26
27func TestBuffer_Bytes(t *testing.T) {
28 t.Parallel()
29 var b Buffer
30 _, _ = b.Write([]byte("hello"))
31
32 got := b.Bytes()
33 assert.Equal(t, []byte("hello"), got)
34
35 // Mutating the returned slice must not affect the buffer.
36 got[0] = 'H'
37 assert.Equal(t, "hello", b.String())
38}
39
40func TestBuffer_Len(t *testing.T) {
41 t.Parallel()

Callers

nothing calls this directly

Calls 3

WriteMethod · 0.95
BytesMethod · 0.95
StringMethod · 0.95

Tested by

no test coverage detected