summaryrefslogtreecommitdiffstats
path: root/hugolib/config_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-08-28 14:18:12 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-08-28 17:00:53 +0200
commitebb56e8bdbfaf4f955326017e40b2805850871e9 (patch)
tree64935a5bfaeb5b2cc8e5c600ad2403d32d3de65c /hugolib/config_test.go
parent6b9934a26615ea614b1774770532cae9762a58d3 (diff)
Improve minifier MIME type resolution
This commit also removes the deprecated `Suffix` from MediaType. Now use `Suffixes` and put the MIME type suffix in the type, e.g. `application/svg+xml`. Fixes #5093
Diffstat (limited to 'hugolib/config_test.go')
-rw-r--r--hugolib/config_test.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/hugolib/config_test.go b/hugolib/config_test.go
index 16d07d1af..1f9e7377c 100644
--- a/hugolib/config_test.go
+++ b/hugolib/config_test.go
@@ -97,7 +97,7 @@ top = "top"
[mediaTypes]
[mediaTypes."text/m1"]
-suffix = "m1main"
+suffixes = ["m1main"]
[outputFormats.o1]
mediaType = "text/m1"
@@ -135,9 +135,9 @@ p3 = "p3 theme"
[mediaTypes]
[mediaTypes."text/m1"]
-suffix = "m1theme"
+suffixes = ["m1theme"]
[mediaTypes."text/m2"]
-suffix = "m2theme"
+suffixes = ["m2theme"]
[outputFormats.o1]
mediaType = "text/m1"
@@ -207,10 +207,14 @@ map[string]interface {}{
b.AssertObject(`
map[string]interface {}{
"text/m1": map[string]interface {}{
- "suffix": "m1main",
+ "suffixes": []interface {}{
+ "m1main",
+ },
},
"text/m2": map[string]interface {}{
- "suffix": "m2theme",
+ "suffixes": []interface {}{
+ "m2theme",
+ },
},
}`, got["mediatypes"])
@@ -221,7 +225,6 @@ map[string]interface {}{
"mediatype": Type{
MainType: "text",
SubType: "m1",
- OldSuffix: "m1main",
Delimiter: ".",
Suffixes: []string{
"m1main",
@@ -233,7 +236,6 @@ map[string]interface {}{
"mediatype": Type{
MainType: "text",
SubType: "m2",
- OldSuffix: "m2theme",
Delimiter: ".",
Suffixes: []string{
"m2theme",