mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
resources/page: Let GroupByParam return nil instead of error
Closes #12578
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
9c4e14eb4f
commit
cba2de6ec9
@@ -142,15 +142,6 @@ func TestGroupByCalledWithEmptyPages(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGroupByParamCalledWithUnavailableKey(t *testing.T) {
|
||||
t.Parallel()
|
||||
pages := preparePageGroupTestPages(t)
|
||||
_, err := pages.GroupByParam("UnavailableKey")
|
||||
if err == nil {
|
||||
t.Errorf("GroupByParam should return an error but didn't")
|
||||
}
|
||||
}
|
||||
|
||||
func TestReverse(t *testing.T) {
|
||||
t.Parallel()
|
||||
pages := preparePageGroupTestPages(t)
|
||||
@@ -256,8 +247,8 @@ func TestGroupByParamCalledWithUnavailableParam(t *testing.T) {
|
||||
t.Parallel()
|
||||
pages := preparePageGroupTestPages(t)
|
||||
_, err := pages.GroupByParam("unavailable_param")
|
||||
if err == nil {
|
||||
t.Errorf("GroupByParam should return an error but didn't")
|
||||
if err != nil {
|
||||
t.Errorf("GroupByParam returned an error when it shouldn't")
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user