mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
@@ -56,7 +56,7 @@ func TestToPages(t *testing.T) {
|
||||
p1, p2 := &testPage{title: "p1"}, &testPage{title: "p2"}
|
||||
pages12 := Pages{p1, p2}
|
||||
|
||||
mustToPages := func(in interface{}) Pages {
|
||||
mustToPages := func(in any) Pages {
|
||||
p, err := ToPages(in)
|
||||
c.Assert(err, qt.IsNil)
|
||||
return p
|
||||
@@ -65,7 +65,7 @@ func TestToPages(t *testing.T) {
|
||||
c.Assert(mustToPages(nil), eq, Pages{})
|
||||
c.Assert(mustToPages(pages12), eq, pages12)
|
||||
c.Assert(mustToPages([]Page{p1, p2}), eq, pages12)
|
||||
c.Assert(mustToPages([]interface{}{p1, p2}), eq, pages12)
|
||||
c.Assert(mustToPages([]any{p1, p2}), eq, pages12)
|
||||
|
||||
_, err := ToPages("not a page")
|
||||
c.Assert(err, qt.Not(qt.IsNil))
|
||||
|
Reference in New Issue
Block a user