MCPcopy
hub / github.com/gofiber/fiber / TestEncodeDecoderedirectionMsg

Function TestEncodeDecoderedirectionMsg

redirect_msgp_test.go:70–92  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

68}
69
70func TestEncodeDecoderedirectionMsg(t *testing.T) {
71 v := redirectionMsg{}
72 var buf bytes.Buffer
73 msgp.Encode(&buf, &v)
74
75 m := v.Msgsize()
76 if buf.Len() > m {
77 t.Log("WARNING: TestEncodeDecoderedirectionMsg Msgsize() is inaccurate")
78 }
79
80 vn := redirectionMsg{}
81 err := msgp.Decode(&buf, &vn)
82 if err != nil {
83 t.Error(err)
84 }
85
86 buf.Reset()
87 msgp.Encode(&buf, &v)
88 err = msgp.NewReader(&buf).Skip()
89 if err != nil {
90 t.Error(err)
91 }
92}
93
94func BenchmarkEncoderedirectionMsg(b *testing.B) {
95 v := redirectionMsg{}

Callers

nothing calls this directly

Calls 4

MsgsizeMethod · 0.95
LenMethod · 0.95
ErrorMethod · 0.65
ResetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…