MCPcopy Index your code
hub / github.com/CodisLabs/codis / TestWriteString

Function TestWriteString

pkg/utils/bufio2/bufio_test.go:117–131  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

115}
116
117func TestWriteString(t *testing.T) {
118 for n := 1; n < 20; n++ {
119 var input string
120 var b bytes.Buffer
121 var w = newWriter(n, &b)
122 for i := 0; i < 10; i++ {
123 s := fmt.Sprintf("hello world %d", i)
124 _, err := w.WriteString(s)
125 assert.MustNoError(err)
126 input += s
127 }
128 assert.MustNoError(w.Flush())
129 assert.Must(b.String() == input)
130 }
131}

Callers

nothing calls this directly

Calls 4

newWriterFunction · 0.85
WriteStringMethod · 0.80
FlushMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected