github.com/abemedia/go-don@v0.2.2-0.20240329015135-be88e32bb73b/encoding/msgpack/msgpack_test.go (about) 1 package msgpack_test 2 3 import ( 4 "testing" 5 6 "github.com/abemedia/go-don/internal/test" 7 ) 8 9 type item struct { 10 Foo string `msgpack:"foo"` 11 } 12 13 var opt = test.EncodingOptions[item]{ 14 Mime: "application/x-msgpack", 15 Raw: "\x81\xa3foo\xa3bar", 16 Parsed: item{Foo: "bar"}, 17 } 18 19 func TestMsgpack(t *testing.T) { 20 test.Encoding(t, opt) 21 } 22 23 func BenchmarkMsgpack(b *testing.B) { 24 test.BenchmarkEncoding(b, opt) 25 }