1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-12 08:23:58 +02:00
go-micro/plugins/config/source/url/format_test.go
2020-12-26 15:32:45 +00:00

24 lines
410 B
Go

package url
import (
"testing"
)
func TestFormat(t *testing.T) {
testCases := []struct {
contentType string
format string
}{
{"application/json", "json"},
{"application/xml", "xml"},
{"application/json", "json"},
}
for _, c := range testCases {
f := format(c.contentType)
if f != c.format {
t.Fatalf("failed to format %s: expected %s got %s", c.contentType, c.format, f)
}
}
}