diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-08-16 15:55:03 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-11-06 19:09:08 +0100 |
commit | 5f6b6ec68936ebbbf590894c02a1a3ecad30735f (patch) | |
tree | f6c91e225a3f24f51af1bde5cfb5b88515d0665d /hugolib/shortcode_test.go | |
parent | 366ee4d8da1c2b0c1751e9bf6d54638439735296 (diff) |
Prepare for Goldmark
This commmit prepares for the addition of Goldmark as the new Markdown renderer in Hugo.
This introduces a new `markup` package with some common interfaces and each implementation in its own package.
See #5963
Diffstat (limited to 'hugolib/shortcode_test.go')
-rw-r--r-- | hugolib/shortcode_test.go | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index 614b8f060..01fa61512 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -18,6 +18,9 @@ import ( "path/filepath" "reflect" + "github.com/gohugoio/hugo/markup/asciidoc" + "github.com/gohugoio/hugo/markup/rst" + "github.com/spf13/viper" "github.com/gohugoio/hugo/parser/pageparser" @@ -27,7 +30,6 @@ import ( "testing" "github.com/gohugoio/hugo/deps" - "github.com/gohugoio/hugo/helpers" "github.com/gohugoio/hugo/tpl" "github.com/spf13/cast" @@ -538,6 +540,19 @@ title: "Foo" "<h1>Hugo!</h1>"}, } + temp := tests[:0] + for _, test := range tests { + if strings.HasSuffix(test.contentPath, ".ad") && !asciidoc.Supports() { + t.Log("Skip Asciidoc test case as no Asciidoc present.") + continue + } else if strings.HasSuffix(test.contentPath, ".rst") && !rst.Supports() { + t.Log("Skip Rst test case as no rst2html present.") + continue + } + temp = append(temp, test) + } + tests = temp + sources := make([][2]string, len(tests)) for i, test := range tests { @@ -578,11 +593,6 @@ title: "Foo" test := test t.Run(fmt.Sprintf("test=%d;contentPath=%s", i, test.contentPath), func(t *testing.T) { t.Parallel() - if strings.HasSuffix(test.contentPath, ".ad") && !helpers.HasAsciidoc() { - t.Skip("Skip Asciidoc test case as no Asciidoc present.") - } else if strings.HasSuffix(test.contentPath, ".rst") && !helpers.HasRst() { - t.Skip("Skip Rst test case as no rst2html present.") - } th := newTestHelper(s.Cfg, s.Fs, t) |