From 9f77f93071d836a35b0078d1b349968abddb4a18 Mon Sep 17 00:00:00 2001 From: bep Date: Sun, 7 Dec 2014 19:48:00 +0100 Subject: 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 --- helpers/url_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'helpers/url_test.go') diff --git a/helpers/url_test.go b/helpers/url_test.go index 4014ee343..1d5c770ea 100644 --- a/helpers/url_test.go +++ b/helpers/url_test.go @@ -69,14 +69,14 @@ func TestUrlPrep(t *testing.T) { } func TestPretty(t *testing.T) { - assert.Equal(t, PrettifyPath("/section/name.html"), "/section/name/index.html") - assert.Equal(t, PrettifyPath("/section/sub/name.html"), "/section/sub/name/index.html") - assert.Equal(t, PrettifyPath("/section/name/"), "/section/name/index.html") - assert.Equal(t, PrettifyPath("/section/name/index.html"), "/section/name/index.html") - assert.Equal(t, PrettifyPath("/index.html"), "/index.html") - assert.Equal(t, PrettifyPath("/name.xml"), "/name/index.xml") - assert.Equal(t, PrettifyPath("/"), "/") - assert.Equal(t, PrettifyPath(""), "/") + assert.Equal(t, PrettifyUrlPath("/section/name.html"), "/section/name/index.html") + assert.Equal(t, PrettifyUrlPath("/section/sub/name.html"), "/section/sub/name/index.html") + assert.Equal(t, PrettifyUrlPath("/section/name/"), "/section/name/index.html") + assert.Equal(t, PrettifyUrlPath("/section/name/index.html"), "/section/name/index.html") + assert.Equal(t, PrettifyUrlPath("/index.html"), "/index.html") + assert.Equal(t, PrettifyUrlPath("/name.xml"), "/name/index.xml") + assert.Equal(t, PrettifyUrlPath("/"), "/") + assert.Equal(t, PrettifyUrlPath(""), "/") assert.Equal(t, PrettifyUrl("/section/name.html"), "/section/name") assert.Equal(t, PrettifyUrl("/section/sub/name.html"), "/section/sub/name") assert.Equal(t, PrettifyUrl("/section/name/"), "/section/name") -- cgit v1.2.3