mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Return error from HandleShortcodes
To be able to test for it.
This commit is contained in:
@@ -20,7 +20,11 @@ func pageFromString(in, filename string) (*Page, error) {
|
||||
func CheckShortCodeMatch(t *testing.T, input, expected string, template tpl.Template) {
|
||||
|
||||
p, _ := pageFromString(SIMPLE_PAGE, "simple.md")
|
||||
output := handleShortcodes(input, p, template)
|
||||
output, err := HandleShortcodes(input, p, template)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("Shortcode rendered error %s. Expected: %q, Got: %q", err, expected, output)
|
||||
}
|
||||
|
||||
if output != expected {
|
||||
t.Fatalf("Shortcode render didn't match. Expected: %q, Got: %q", expected, output)
|
||||
|
Reference in New Issue
Block a user