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

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