mirror of
https://github.com/gofiber/fiber.git
synced 2025-04-27 21:25:34 +00:00
* internal: revert linting changes Changes to the internal package should not have been made in 167a8b5e9421e0ab51fbf44c5621632f4a1a90c5. * middleware/monitor: revert changes to exported field "ChartJSURL" This is a breaking change introduced in 167a8b5e9421e0ab51fbf44c5621632f4a1a90c5. * middleware/monitor: fix error checking Fix the errorenous error checking introduced in 167a8b5e9421e0ab51fbf44c5621632f4a1a90c5. * 🐛 Bug: Fix issues introduced in linting PR #2319 * 🐛 Bug: Fix issues introduced in linting PR #2319 * Bug: Fix issues introduced in linting PR #2319 --------- Co-authored-by: René Werner <rene@gofiber.io>
68 lines
1.2 KiB
Go
68 lines
1.2 KiB
Go
package idempotency
|
|
|
|
// Code generated by github.com/tinylib/msgp DO NOT EDIT.
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/tinylib/msgp/msgp"
|
|
)
|
|
|
|
func TestMarshalUnmarshalresponse(t *testing.T) {
|
|
v := response{}
|
|
bts, err := v.MarshalMsg(nil)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
left, err := v.UnmarshalMsg(bts)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if len(left) > 0 {
|
|
t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
|
|
}
|
|
|
|
left, err = msgp.Skip(bts)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if len(left) > 0 {
|
|
t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
|
|
}
|
|
}
|
|
|
|
func BenchmarkMarshalMsgresponse(b *testing.B) {
|
|
v := response{}
|
|
b.ReportAllocs()
|
|
b.ResetTimer()
|
|
for i := 0; i < b.N; i++ {
|
|
v.MarshalMsg(nil)
|
|
}
|
|
}
|
|
|
|
func BenchmarkAppendMsgresponse(b *testing.B) {
|
|
v := response{}
|
|
bts := make([]byte, 0, v.Msgsize())
|
|
bts, _ = v.MarshalMsg(bts[0:0])
|
|
b.SetBytes(int64(len(bts)))
|
|
b.ReportAllocs()
|
|
b.ResetTimer()
|
|
for i := 0; i < b.N; i++ {
|
|
bts, _ = v.MarshalMsg(bts[0:0])
|
|
}
|
|
}
|
|
|
|
func BenchmarkUnmarshalresponse(b *testing.B) {
|
|
v := response{}
|
|
bts, _ := v.MarshalMsg(nil)
|
|
b.ReportAllocs()
|
|
b.SetBytes(int64(len(bts)))
|
|
b.ResetTimer()
|
|
for i := 0; i < b.N; i++ {
|
|
_, err := v.UnmarshalMsg(bts)
|
|
if err != nil {
|
|
b.Fatal(err)
|
|
}
|
|
}
|
|
}
|