mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-23 21:53:09 +02:00
Revert "tpl: Rework to handle both text and HTML templates"
Will have to take another stab at this ...
This reverts commit 5c5efa03d2
.
Closes #3260
This commit is contained in:
@@ -65,7 +65,7 @@ func TestDefaultTypes(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
func TestGetFormat(t *testing.T) {
|
||||
func TestGetType(t *testing.T) {
|
||||
tp, _ := GetFormat("html")
|
||||
require.Equal(t, HTMLFormat, tp)
|
||||
tp, _ = GetFormat("HTML")
|
||||
@@ -73,28 +73,3 @@ func TestGetFormat(t *testing.T) {
|
||||
_, found := GetFormat("FOO")
|
||||
require.False(t, found)
|
||||
}
|
||||
|
||||
func TestGeGetFormatByName(t *testing.T) {
|
||||
formats := Formats{AMPFormat, CalendarFormat}
|
||||
tp, _ := formats.GetByName("AMP")
|
||||
require.Equal(t, AMPFormat, tp)
|
||||
_, found := formats.GetByName("HTML")
|
||||
require.False(t, found)
|
||||
_, found = formats.GetByName("FOO")
|
||||
require.False(t, found)
|
||||
}
|
||||
|
||||
func TestGeGetFormatByExt(t *testing.T) {
|
||||
formats1 := Formats{AMPFormat, CalendarFormat}
|
||||
formats2 := Formats{AMPFormat, HTMLFormat, CalendarFormat}
|
||||
tp, _ := formats1.GetBySuffix("html")
|
||||
require.Equal(t, AMPFormat, tp)
|
||||
tp, _ = formats1.GetBySuffix("ics")
|
||||
require.Equal(t, CalendarFormat, tp)
|
||||
_, found := formats1.GetBySuffix("not")
|
||||
require.False(t, found)
|
||||
|
||||
// ambiguous
|
||||
_, found = formats2.GetByName("html")
|
||||
require.False(t, found)
|
||||
}
|
||||
|
Reference in New Issue
Block a user