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

Function TestBuffer_slice_int8

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

Source from the content-addressed store, hash-verified

360}
361
362func TestBuffer_slice_int8(t *testing.T) {
363 var want = []int8{1, 2, 3, 4, 5}
364 var got []int8
365 buf := NewBuffer()
366 err := buf.WriteSliceInt8(want)
367 if err != nil {
368 t.Errorf("Test Write_slice_int8 failed. err:%s\n", err)
369 }
370 reader := r(buf)
371 err = reader.ReadSliceInt8(&got, int32(len(want)), true)
372 if err != nil {
373 t.Errorf("Test Read_slice_int8 failed. err:%s\n", err)
374 }
375
376 if !reflect.DeepEqual(want, got) {
377 t.Errorf("Test Write_slice_int8 failed. want:%v, got:%v\n", want, got)
378 }
379}
380
381func TestBuffer_bytes(t *testing.T) {
382 var wants = [][]byte{

Callers

nothing calls this directly

Calls 5

WriteSliceInt8Method · 0.95
NewBufferFunction · 0.85
rFunction · 0.85
ReadSliceInt8Method · 0.80
ErrorfMethod · 0.45

Tested by

no test coverage detected