github.com/abemedia/go-don@v0.2.2-0.20240329015135-be88e32bb73b/encoding/yaml/yaml_test.go (about)

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