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