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

Function TestWrite

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

Source from the content-addressed store, hash-verified

86}
87
88func TestWrite(t *testing.T) {
89 for n := 1; n < 20; n++ {
90 var input string
91 var b bytes.Buffer
92 var w = newWriter(n, &b)
93 for i := 0; i < 10; i++ {
94 s := fmt.Sprintf("hello world %d", i)
95 _, err := w.Write([]byte(s))
96 assert.MustNoError(err)
97 input += s
98 }
99 assert.MustNoError(w.Flush())
100 assert.Must(b.String() == input)
101 }
102}
103
104func TestWriteBytes(t *testing.T) {
105 var input = "hello world!!"

Callers

nothing calls this directly

Calls 4

newWriterFunction · 0.85
WriteMethod · 0.45
FlushMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected