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

Function TestBuffer_Write

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

Source from the content-addressed store, hash-verified

10)
11
12func TestBuffer_Write(t *testing.T) {
13 t.Parallel()
14 var b Buffer
15
16 n, err := b.Write([]byte("hello"))
17 require.NoError(t, err)
18 assert.Equal(t, 5, n)
19
20 n, err = b.Write([]byte(" world"))
21 require.NoError(t, err)
22 assert.Equal(t, 6, n)
23
24 assert.Equal(t, "hello world", b.String())
25}
26
27func TestBuffer_Bytes(t *testing.T) {
28 t.Parallel()

Callers

nothing calls this directly

Calls 2

WriteMethod · 0.95
StringMethod · 0.95

Tested by

no test coverage detected