mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-29 23:12:10 -05:00
67df33f500
First step to use initialisms that golint suggests, for example: Line 116: func GetHtmlRenderer should be GetHTMLRenderer as see on http://goreportcard.com/report/spf13/hugo Thanks to @bep for the idea! Note that command-line flags (cobra and pflag) as well as struct fields like .BaseUrl and .Url that are used in Go HTML templates need more work to maintain backward-compatibility, and thus are NOT yet dealt with in this commit. First step in fixing #959.
18 lines
447 B
Go
18 lines
447 B
Go
package hugolib
|
|
|
|
import (
|
|
"github.com/spf13/hugo/tpl"
|
|
"testing"
|
|
)
|
|
|
|
const (
|
|
win_base = "c:\\a\\windows\\path\\layout"
|
|
win_path = "c:\\a\\windows\\path\\layout\\sub1\\index.html"
|
|
)
|
|
|
|
func TestTemplatePathSeparator(t *testing.T) {
|
|
tmpl := new(tpl.GoHTMLTemplate)
|
|
if name := tmpl.GenerateTemplateNameFrom(win_base, win_path); name != "sub1/index.html" {
|
|
t.Fatalf("Template name incorrect. Expected: %s, Got: %s", "sub1/index.html", name)
|
|
}
|
|
}
|