diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-10-20 10:11:48 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-04-05 18:00:44 +0200 |
commit | e58a540895c28b8884823dcb1b64c272422f9923 (patch) | |
tree | 3fefb267f87e61a969a6ccf776d75fe64b50b2b1 /hugolib/pagebundler_test.go | |
parent | 20162518c450770ebfd54e0e987f34a5cccf236b (diff) |
resources: Create a common ResourceFinder interface
And make both .Resources and resources implement it.
This gets us 2 new methods/functions, so you can now also do:
* .Resources.Get
* resources.ByType
Note that GetRemote is not covered by this interface, as that is only available as a global template function.
Fixes #8653
Diffstat (limited to 'hugolib/pagebundler_test.go')
-rw-r--r-- | hugolib/pagebundler_test.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hugolib/pagebundler_test.go b/hugolib/pagebundler_test.go index d7a83d79d..cbad36520 100644 --- a/hugolib/pagebundler_test.go +++ b/hugolib/pagebundler_test.go @@ -553,7 +553,8 @@ HEADLESS {{< myShort >}} headlessResources := headless.Resources() c.Assert(len(headlessResources), qt.Equals, 3) - c.Assert(len(headlessResources.Match("l*")), qt.Equals, 2) + res := headlessResources.Match("l*") + c.Assert(len(res), qt.Equals, 2) pageResource := headlessResources.GetMatch("p*") c.Assert(pageResource, qt.Not(qt.IsNil)) p := pageResource.(page.Page) |