MCPcopy
hub / github.com/TarsCloud/TarsGo / TestReader_Reset

Function TestReader_Reset

tars/protocol/codec/codec_test.go:499–513  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

497}
498
499func TestReader_Reset(t *testing.T) {
500 writer := NewBuffer()
501 err := writer.WriteBytes([]byte("test"))
502 if err != nil {
503 t.Errorf("Write bytes failed")
504 }
505 reader := r(writer)
506 reader.Reset([]byte{})
507 writer.Reset()
508
509 if writer.buf.String() != reader.ToString() {
510 t.Errorf("Test Reset failed. want:%q, got:%q\n",
511 writer.buf.String(), reader.ToString())
512 }
513}
514
515func TestReader_Skip(t *testing.T) {
516 writer := NewBuffer()

Callers

nothing calls this directly

Calls 7

WriteBytesMethod · 0.95
ResetMethod · 0.95
NewBufferFunction · 0.85
rFunction · 0.85
ErrorfMethod · 0.45
StringMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected