diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-03-14 15:41:03 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-03-14 15:41:03 +0100 |
commit | dea185aa9b62e1660cb5c6e79e90f2078db7fe6f (patch) | |
tree | 3935af1bcbf6254d48ca86dfb9b9bf27da453c87 /hugolib/site_test.go | |
parent | c21dc16dbe9d9cf44b341f1f995ed7776d6a1b62 (diff) |
hugolib: Remove unused code
Diffstat (limited to 'hugolib/site_test.go')
-rw-r--r-- | hugolib/site_test.go | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/hugolib/site_test.go b/hugolib/site_test.go index dec6cb29c..700aa8a98 100644 --- a/hugolib/site_test.go +++ b/hugolib/site_test.go @@ -41,18 +41,11 @@ title: simple template --- content` - TEMPLATE_MISSING_FUNC = "{{ .Title | funcdoesnotexists }}" - TEMPLATE_FUNC = "{{ .Title | urlize }}" - TEMPLATE_CONTENT = "{{ .Content }}" - TEMPLATE_DATE = "{{ .Date }}" - INVALID_TEMPLATE_FORMAT_DATE = "{{ .Date.Format time.RFC3339 }}" - TEMPLATE_WITH_URL_REL = "<a href=\"foobar.jpg\">Going</a>" - TEMPLATE_WITH_URL_ABS = "<a href=\"/foobar.jpg\">Going</a>" - PAGE_URL_SPECIFIED = `--- -title: simple template -url: "mycategory/my-whatever-content/" ---- -content` + TEMPLATE_MISSING_FUNC = "{{ .Title | funcdoesnotexists }}" + TEMPLATE_FUNC = "{{ .Title | urlize }}" + TEMPLATE_CONTENT = "{{ .Content }}" + TEMPLATE_DATE = "{{ .Date }}" + TEMPLATE_WITH_URL_ABS = "<a href=\"/foobar.jpg\">Going</a>" PAGE_WITH_MD = `--- title: page with md @@ -149,18 +142,6 @@ func NopCloser(w io.Writer) io.WriteCloser { return nopCloser{w} } -func matchRender(t *testing.T, s *Site, p *Page, tmplName string, expected string) { - content := new(bytes.Buffer) - err := s.renderThing(p, tmplName, NopCloser(content)) - if err != nil { - t.Fatalf("Unable to render template.") - } - - if string(content.Bytes()) != expected { - t.Fatalf("Content did not match expected: %s. got: %s", expected, content) - } -} - func TestRenderThing(t *testing.T) { tests := []struct { content string @@ -209,15 +190,14 @@ func HTML(in string) string { func TestRenderThingOrDefault(t *testing.T) { tests := []struct { - content string missing bool template string expected string }{ - {PAGE_SIMPLE_TITLE, true, TEMPLATE_TITLE, HTML("simple template")}, - {PAGE_SIMPLE_TITLE, true, TEMPLATE_FUNC, HTML("simple-template")}, - {PAGE_SIMPLE_TITLE, false, TEMPLATE_TITLE, HTML("simple template")}, - {PAGE_SIMPLE_TITLE, false, TEMPLATE_FUNC, HTML("simple-template")}, + {true, TEMPLATE_TITLE, HTML("simple template")}, + {true, TEMPLATE_FUNC, HTML("simple-template")}, + {false, TEMPLATE_TITLE, HTML("simple template")}, + {false, TEMPLATE_FUNC, HTML("simple-template")}, } hugofs.DestinationFS = new(afero.MemMapFs) |