MCPcopy Create free account
hub / github.com/chain/Core / TestReadWriteVarstr31

Function TestReadWriteVarstr31

encoding/blockchain/blockchain_test.go:347–360  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

345}
346
347func TestReadWriteVarstr31(t *testing.T) {
348 f := func(x []byte) bool {
349 var buf bytes.Buffer
350 _, err := WriteVarstr31(&buf, x)
351 if err != nil {
352 return false
353 }
354 got, err := ReadVarstr31(NewReader(buf.Bytes()))
355 return bytes.Equal(got, x) && err == nil
356 }
357 if err := quick.Check(f, nil); err != nil {
358 t.Error(err)
359 }
360}
361
362func TestReadWriteVarstrList(t *testing.T) {
363 f := func(x [][]byte) bool {

Callers

nothing calls this directly

Calls 7

WriteVarstr31Function · 0.85
ReadVarstr31Function · 0.85
NewReaderFunction · 0.85
CheckMethod · 0.80
BytesMethod · 0.45
EqualMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected