MCPcopy
hub / github.com/docker/docker-agent / TestBuffer_Drain

Function TestBuffer_Drain

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

Source from the content-addressed store, hash-verified

60}
61
62func TestBuffer_Drain(t *testing.T) {
63 t.Parallel()
64 var b Buffer
65 _, _ = b.Write([]byte("hello"))
66
67 got := b.Drain()
68 assert.Equal(t, "hello", got)
69 assert.Equal(t, 0, b.Len())
70 assert.Empty(t, b.String())
71}
72
73func TestBuffer_Concurrent(t *testing.T) {
74 t.Parallel()

Callers

nothing calls this directly

Calls 4

WriteMethod · 0.95
DrainMethod · 0.95
LenMethod · 0.95
StringMethod · 0.95

Tested by

no test coverage detected