hugo/hugolib/path_seperators_windows_test.go
bep 9f77f93071 Fix various Windows-issues
File handling was broken on Windows. This commit contains a revision of the path handling with separation of file paths and urls where needed.

There may be remaining issues and there may be better ways to do this, but it is easier to start that refactoring job with a set of passing tests.

Fixes #687
Fixes #660
2014-12-09 09:43:15 -05:00

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 TestTemplatePathSeperator(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)
}
}