MCPcopy
hub / github.com/CodisLabs/codis / TestWriteBytes

Function TestWriteBytes

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

Source from the content-addressed store, hash-verified

102}
103
104func TestWriteBytes(t *testing.T) {
105 var input = "hello world!!"
106 for n := 1; n < 20; n++ {
107 var b bytes.Buffer
108 var w = newWriter(n, &b)
109 for i := 0; i < len(input); i++ {
110 assert.MustNoError(w.WriteByte(input[i]))
111 }
112 assert.MustNoError(w.Flush())
113 assert.Must(b.String() == input)
114 }
115}
116
117func TestWriteString(t *testing.T) {
118 for n := 1; n < 20; n++ {

Callers

nothing calls this directly

Calls 4

newWriterFunction · 0.85
WriteByteMethod · 0.80
FlushMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected