Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Waller <o.waller@kulawe.com>2014-10-12 02:49:53 +0400
committerspf13 <steve.francia@gmail.com>2014-11-05 03:19:27 +0300
commite2634752ce7dcc2f6cf1902b0409206e0ed8a571 (patch)
tree566effd0cd6fe8e0ab033f24b20ec1d42596a48d /helpers
parentf81f9ceb40db8b3dbb586e52a3939dd8a136502f (diff)
First stab at correcting GuessSection tests
Updated the test to correctly test for "" when a non-absolute path is used. But the tests still fail for multi-part paths e.g. /contents/blog/
Diffstat (limited to 'helpers')
-rw-r--r--helpers/path_test.go22
1 files changed, 13 insertions, 9 deletions
diff --git a/helpers/path_test.go b/helpers/path_test.go
index e6dc1e761..607918581 100644
--- a/helpers/path_test.go
+++ b/helpers/path_test.go
@@ -421,15 +421,19 @@ func TestGuessSection(t *testing.T) {
data := []test{
{"/", ""},
{"", ""},
- {"/content", "/"},
- {"content/", "/"},
- {"/content/", "/"},
- {"/blog", "/blog"},
- {"/blog/", "/blog/"},
- {"blog", "blog"},
- {"content/blog", "/blog"},
- {"content/blog/", "/blog/"},
- {"/content/blog", "/blog/"},
+ {"/content", ""},
+ {"content/", ""},
+ {"/content/", "content"},
+ {"/blog", ""},
+ {"/blog/", "blog"},
+ {"blog", ""},
+ {"content/blog", ""},
+ {"/content/blog/", "blog"},
+ {"/content/blog", "blog"},
+ {"content/blog/", ""},
+ {"/contents/myblog/", "contents"},
+ {"/contents/yourblog", "contents"},
+ {"/contents/ourblog/", "contents"},
}
for i, d := range data {