shithub: hugo

ref: be4a9dd5d283a4f2f7fc78aa00c28021e81d9e5b
dir: /hugolib/path_separators_windows_test.go/

View raw version
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)
	}
}