aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/site_url_test.go
diff options
context:
space:
mode:
authorbep <[email protected]>2014-12-07 19:48:00 +0100
committerspf13 <[email protected]>2014-12-09 09:43:15 -0500
commit9f77f93071d836a35b0078d1b349968abddb4a18 (patch)
tree909238a41b20b9e23324e4ffca01e8143655dd4a /hugolib/site_url_test.go
parent3a8c12418a97230df714488e522f44ce8af685c5 (diff)
downloadhugo-9f77f93071d836a35b0078d1b349968abddb4a18.tar.gz
hugo-9f77f93071d836a35b0078d1b349968abddb4a18.zip
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
Diffstat (limited to 'hugolib/site_url_test.go')
-rw-r--r--hugolib/site_url_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/hugolib/site_url_test.go b/hugolib/site_url_test.go
index c0825e56b..331cbc49f 100644
--- a/hugolib/site_url_test.go
+++ b/hugolib/site_url_test.go
@@ -2,6 +2,7 @@ package hugolib
import (
"html/template"
+ "path/filepath"
"testing"
"github.com/spf13/afero"
@@ -47,8 +48,8 @@ func (t *InMemoryAliasTarget) Publish(label string, permalink template.HTML) (er
}
var urlFakeSource = []source.ByteSource{
- {"content/blue/doc1.md", []byte(SLUG_DOC_1)},
- {"content/blue/doc2.md", []byte(SLUG_DOC_2)},
+ {filepath.FromSlash("content/blue/doc1.md"), []byte(SLUG_DOC_1)},
+ {filepath.FromSlash("content/blue/doc2.md"), []byte(SLUG_DOC_2)},
}
func TestPageCount(t *testing.T) {
@@ -93,7 +94,7 @@ func TestPageCount(t *testing.T) {
"sd3/index.html",
"sd4.html",
} {
- if _, err := hugofs.DestinationFS.Open(s); err != nil {
+ if _, err := hugofs.DestinationFS.Open(filepath.FromSlash(s)); err != nil {
t.Errorf("No alias rendered: %s", s)
}
}