summaryrefslogtreecommitdiffstats
path: root/hugolib/resource_chain_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-12-09 16:16:35 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-12-10 11:10:41 +0100
commit6260455ba73e2f2bd16b068a72e98e48b037a179 (patch)
tree0b675e34b917381341b305780863330fce2919d5 /hugolib/resource_chain_test.go
parentc397975af818d27794e673cf9e464c2430ded49e (diff)
Make resource.Get return nil on 404 not found
This is in line with the interface declaration and also how local lookups work. Fixes #9267
Diffstat (limited to 'hugolib/resource_chain_test.go')
-rw-r--r--hugolib/resource_chain_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/hugolib/resource_chain_test.go b/hugolib/resource_chain_test.go
index 05e8a9d00..efd28a95d 100644
--- a/hugolib/resource_chain_test.go
+++ b/hugolib/resource_chain_test.go
@@ -413,11 +413,15 @@ CSS integrity Data first: {{ $cssFingerprinted1.Data.Integrity }} {{ $cssFingerp
CSS integrity Data last: {{ $cssFingerprinted2.RelPermalink }} {{ $cssFingerprinted2.Data.Integrity }}
{{ $rimg := resources.Get "%[1]s/sunset.jpg" }}
+{{ $remotenotfound := resources.Get "%[1]s/notfound.jpg" }}
+{{ $localnotfound := resources.Get "images/notfound.jpg" }}
{{ $rfit := $rimg.Fit "200x200" }}
{{ $rfit2 := $rfit.Fit "100x200" }}
{{ $rimg = $rimg | fingerprint }}
SUNSET REMOTE: {{ $rimg.Name }}|{{ $rimg.RelPermalink }}|{{ $rimg.Width }}|{{ len $rimg.Content }}
FIT REMOTE: {{ $rfit.Name }}|{{ $rfit.RelPermalink }}|{{ $rfit.Width }}
+REMOTE NOT FOUND: {{ if $remotenotfound }}FAILED{{ else}}OK{{ end }}
+LOCAL NOT FOUND: {{ if $localnotfound }}FAILED{{ else}}OK{{ end }}
`, ts.URL))
@@ -448,6 +452,9 @@ CSS integrity Data last: /styles2.min.1cfc52986836405d37f9998a63fd6dd8608e8c410
SUNSET REMOTE: sunset_%[1]s.jpg|/sunset_%[1]s.a9bf1d944e19c0f382e0d8f51de690f7d0bc8fa97390c4242a86c3e5c0737e71.jpg|900|90587
FIT REMOTE: sunset_%[1]s.jpg|/sunset_%[1]s_hu59e56ffff1bc1d8d122b1403d34e039f_0_200x200_fit_q75_box.jpg|200
+REMOTE NOT FOUND: OK
+LOCAL NOT FOUND: OK
+
`, helpers.HashString(ts.URL+"/sunset.jpg", map[string]interface{}{})))