MCPcopy
hub / github.com/docker/compose / TestSplitWriter

Function TestSplitWriter

pkg/utils/writer_test.go:26–39  ·  pkg/utils/writer_test.go::TestSplitWriter

nolint:errcheck

(t *testing.T)

Source from the content-addressed store, hash-verified

24
25//nolint:errcheck
26func TestSplitWriter(t *testing.T) {
27 var lines []string
28 w := GetWriter(func(line string) {
29 lines = append(lines, line)
30 })
31 w.Write([]byte("h"))
32 w.Write([]byte("e"))
33 w.Write([]byte("l"))
34 w.Write([]byte("l"))
35 w.Write([]byte("o"))
36 w.Write([]byte("\n"))
37 w.Write([]byte("world!\n"))
38 assert.DeepEqual(t, lines, []string{"hello", "world!"})
39}

Callers

nothing calls this directly

Calls 2

GetWriterFunction · 0.85
WriteMethod · 0.45

Tested by

no test coverage detected