Fix broken Highlight test
authorbep <bjorn.erik.pedersen@gmail.com>
Thu, 16 Apr 2015 00:20:15 +0000 (02:20 +0200)
committerbep <bjorn.erik.pedersen@gmail.com>
Thu, 16 Apr 2015 00:20:10 +0000 (02:20 +0200)
hugolib/shortcode_test.go
tpl/template_embedded.go

index 2c48162e5033d9b178ce28216497d0b022e2ac85..ad1bd3ac850e92ef69d4bd5ff3c4283dcfecd1d9 100644 (file)
@@ -143,8 +143,7 @@ func TestFigureImgWidth(t *testing.T) {
        CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" alt="apple" width="100px" %}}`, "\n<figure class=\"bananas orange\">\n    \n        <img src=\"/found/here\" alt=\"apple\" width=\"100px\" />\n    \n    \n</figure>\n", tem)
 }
 
-// TODO(bep)
-func _TestHighlight(t *testing.T) {
+func TestHighlight(t *testing.T) {
        if !helpers.HasPygments() {
                t.Skip("Skip test as Pygments is not installed")
        }
index 48de62cb6b4304cfa23a2d6c5c48961540ede101..317959f299be390f69ebc4bc3aab0e266c4a4587 100644 (file)
@@ -21,13 +21,7 @@ type Tmpl struct {
 func (t *GoHTMLTemplate) EmbedShortcodes() {
        t.AddInternalShortcode("ref.html", `{{ .Get 0 | ref .Page }}`)
        t.AddInternalShortcode("relref.html", `{{ .Get 0 | relref .Page }}`)
-       t.AddInternalShortcode("highlight.html", `
-       {{ if len .Params | eq 2 }}
-       {{ highlight .Inner (.Get 0) (.Get 1) }}
-       {{ else }}
-       {{ highlight .Inner (.Get 0) "" }}
-       {{ end }}
-       `)
+       t.AddInternalShortcode("highlight.html", `{{ if len .Params | eq 2 }}{{ highlight .Inner (.Get 0) (.Get 1) }}{{ else }}{{ highlight .Inner (.Get 0) "" }}{{ end }}`)
        t.AddInternalShortcode("test.html", `This is a simple Test`)
        t.AddInternalShortcode("figure.html", `<!-- image -->
 <figure {{ with .Get "class" }}class="{{.}}"{{ end }}>