MCPcopy
hub / github.com/gogo/protobuf / TestBytesPrimitives

Function TestBytesPrimitives

proto/all_test.go:412–423  ·  view source on GitHub ↗

Simple tests for bytes

(t *testing.T)

Source from the content-addressed store, hash-verified

410
411// Simple tests for bytes
412func TestBytesPrimitives(t *testing.T) {
413 o := old()
414 bytes := []byte{'n', 'o', 'w', ' ', 'i', 's', ' ', 't', 'h', 'e', ' ', 't', 'i', 'm', 'e'}
415 if o.EncodeRawBytes(bytes) != nil {
416 t.Error("EncodeRawBytes")
417 }
418 decb, e := o.DecodeRawBytes(false)
419 if e != nil {
420 t.Error("DecodeRawBytes")
421 }
422 equalbytes(bytes, decb, t)
423}
424
425// Simple tests for strings
426func TestStringPrimitives(t *testing.T) {

Callers

nothing calls this directly

Calls 5

oldFunction · 0.85
equalbytesFunction · 0.85
EncodeRawBytesMethod · 0.80
DecodeRawBytesMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…