mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
tpl/collections: Make delimit return a string
Closes #10876 Closes #11502
This commit is contained in:
@@ -71,8 +71,7 @@ func TestAfter(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
type tstGrouper struct {
|
||||
}
|
||||
type tstGrouper struct{}
|
||||
|
||||
type tstGroupers []*tstGrouper
|
||||
|
||||
@@ -81,8 +80,7 @@ func (g tstGrouper) Group(key any, items any) (any, error) {
|
||||
return fmt.Sprintf("%v(%d)", key, ilen), nil
|
||||
}
|
||||
|
||||
type tstGrouper2 struct {
|
||||
}
|
||||
type tstGrouper2 struct{}
|
||||
|
||||
func (g *tstGrouper2) Group(key any, items any) (any, error) {
|
||||
ilen := reflect.ValueOf(items).Len()
|
||||
@@ -134,7 +132,7 @@ func TestDelimit(t *testing.T) {
|
||||
seq any
|
||||
delimiter any
|
||||
last any
|
||||
expect template.HTML
|
||||
expect string
|
||||
}{
|
||||
{[]string{"class1", "class2", "class3"}, " ", nil, "class1 class2 class3"},
|
||||
{[]int{1, 2, 3, 4, 5}, ",", nil, "1,2,3,4,5"},
|
||||
@@ -163,7 +161,7 @@ func TestDelimit(t *testing.T) {
|
||||
} {
|
||||
errMsg := qt.Commentf("[%d] %v", i, test)
|
||||
|
||||
var result template.HTML
|
||||
var result string
|
||||
var err error
|
||||
|
||||
if test.last == nil {
|
||||
|
Reference in New Issue
Block a user