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

Function TestSkipStruct

tars/protocol/codec/codec_test.go:207–230  ·  view source on GitHub ↗

TestSkipStruct tests skip struct.

(t *testing.T)

Source from the content-addressed store, hash-verified

205
206// TestSkipStruct tests skip struct.
207func TestSkipStruct(t *testing.T) {
208 b := NewBuffer()
209
210 err := b.WriteHead(StructBegin, 1)
211 if err != nil {
212 t.Error(err)
213 }
214
215 err = b.WriteHead(StructEnd, 0)
216 if err != nil {
217 t.Error(err)
218 }
219
220 rd := r(b)
221
222 have, err := rd.SkipTo(StructBegin, 1, true)
223 if err != nil || have == false {
224 t.Error(err)
225 }
226 err = rd.SkipToStructEnd()
227 if err != nil || have == false {
228 t.Error(err)
229 }
230}
231
232// TestSkipStruct2 tests skip struct.
233func TestSkipStruct2(t *testing.T) {

Callers

nothing calls this directly

Calls 6

WriteHeadMethod · 0.95
NewBufferFunction · 0.85
rFunction · 0.85
SkipToMethod · 0.80
SkipToStructEndMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected