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/
This commit is contained in:
Owen Waller 2014-10-11 23:49:53 +01:00 committed by spf13
parent f81f9ceb40
commit e2634752ce
1 changed files with 13 additions and 9 deletions

View File

@ -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 {