MCPcopy Create free account
hub / github.com/segmentio/encoding / assertParse

Function assertParse

proto/message_test.go:135–156  ·  view source on GitHub ↗
(t *testing.T, m RawMessage, f FieldNumber, w WireType, b []byte)

Source from the content-addressed store, hash-verified

133}
134
135func assertParse(t *testing.T, m RawMessage, f FieldNumber, w WireType, b []byte) RawMessage {
136 t.Helper()
137
138 f0, w0, b0, m, err := Parse(m)
139 if err != nil {
140 t.Fatal(err)
141 }
142
143 if f0 != f {
144 t.Errorf("field number mismatch, want %d but got %d", f, f0)
145 }
146
147 if w0 != w {
148 t.Errorf("wire type mismatch, want %d but got %d", w, w0)
149 }
150
151 if !bytes.Equal(b0, b) {
152 t.Errorf("value mismatch, want %v but got %v", b, b0)
153 }
154
155 return m
156}
157
158func assertEmpty(t *testing.T, m RawMessage) {
159 t.Helper()

Callers 1

TestDecodeFixtureFunction · 0.85

Calls 1

ParseFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…