mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
@@ -135,6 +135,8 @@ var (
|
||||
XMLType = Type{MainType: "application", SubType: "xml", Suffixes: []string{"xml"}, Delimiter: defaultDelimiter}
|
||||
SVGType = Type{MainType: "image", SubType: "svg", mimeSuffix: "xml", Suffixes: []string{"svg"}, Delimiter: defaultDelimiter}
|
||||
TextType = Type{MainType: "text", SubType: "plain", Suffixes: []string{"txt"}, Delimiter: defaultDelimiter}
|
||||
TOMLType = Type{MainType: "application", SubType: "toml", Suffixes: []string{"toml"}, Delimiter: defaultDelimiter}
|
||||
YAMLType = Type{MainType: "application", SubType: "yaml", Suffixes: []string{"yaml", "yml"}, Delimiter: defaultDelimiter}
|
||||
|
||||
OctetType = Type{MainType: "application", SubType: "octet-stream"}
|
||||
)
|
||||
@@ -154,6 +156,8 @@ var DefaultTypes = Types{
|
||||
SVGType,
|
||||
TextType,
|
||||
OctetType,
|
||||
YAMLType,
|
||||
TOMLType,
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
@@ -39,6 +39,8 @@ func TestDefaultTypes(t *testing.T) {
|
||||
{SVGType, "image", "svg", "svg", "image/svg+xml", "image/svg+xml"},
|
||||
{TextType, "text", "plain", "txt", "text/plain", "text/plain"},
|
||||
{XMLType, "application", "xml", "xml", "application/xml", "application/xml"},
|
||||
{TOMLType, "application", "toml", "toml", "application/toml", "application/toml"},
|
||||
{YAMLType, "application", "yaml", "yaml", "application/yaml", "application/yaml"},
|
||||
} {
|
||||
require.Equal(t, test.expectedMainType, test.tp.MainType)
|
||||
require.Equal(t, test.expectedSubType, test.tp.SubType)
|
||||
@@ -50,6 +52,8 @@ func TestDefaultTypes(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
require.Equal(t, 15, len(DefaultTypes))
|
||||
|
||||
}
|
||||
|
||||
func TestGetByType(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user