MCPcopy Create free account
hub / github.com/CrowdStrike/csproto / TestEncodePackedBool

Function TestEncodePackedBool

encoder_test.go:41–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

39}
40
41func TestEncodePackedBool(t *testing.T) {
42 dest := make([]byte, 5)
43 enc := csproto.NewEncoder(dest)
44 enc.EncodePackedBool(1, []bool{true, false, true})
45
46 expected := []byte{
47 // tag=1, wire type=2
48 0x0a,
49 // total length (3)
50 0x03,
51 // true, false, true
52 0x01, 0x00, 0x01,
53 }
54 assert.Equal(t, expected, dest)
55}
56
57func TestEncodeString(t *testing.T) {
58 cases := []struct {

Callers

nothing calls this directly

Calls 2

EncodePackedBoolMethod · 0.95
NewEncoderFunction · 0.92

Tested by

no test coverage detected