From: Owen Waller Date: Sat, 11 Oct 2014 22:49:53 +0000 (+0100) Subject: First stab at correcting GuessSection tests X-Git-Tag: v0.13~328 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e2634752ce7dcc2f6cf1902b0409206e0ed8a571;p=brevno-suite%2Fhugo 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/ --- diff --git a/helpers/path_test.go b/helpers/path_test.go index e6dc1e76..60791858 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 {