mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-16 20:53:59 +02:00
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:
@@ -421,15 +421,19 @@ func TestGuessSection(t *testing.T) {
|
|||||||
data := []test{
|
data := []test{
|
||||||
{"/", ""},
|
{"/", ""},
|
||||||
{"", ""},
|
{"", ""},
|
||||||
{"/content", "/"},
|
{"/content", ""},
|
||||||
{"content/", "/"},
|
{"content/", ""},
|
||||||
{"/content/", "/"},
|
{"/content/", "content"},
|
||||||
{"/blog", "/blog"},
|
{"/blog", ""},
|
||||||
{"/blog/", "/blog/"},
|
{"/blog/", "blog"},
|
||||||
{"blog", "blog"},
|
{"blog", ""},
|
||||||
{"content/blog", "/blog"},
|
{"content/blog", ""},
|
||||||
{"content/blog/", "/blog/"},
|
{"/content/blog/", "blog"},
|
||||||
{"/content/blog", "/blog/"},
|
{"/content/blog", "blog"},
|
||||||
|
{"content/blog/", ""},
|
||||||
|
{"/contents/myblog/", "contents"},
|
||||||
|
{"/contents/yourblog", "contents"},
|
||||||
|
{"/contents/ourblog/", "contents"},
|
||||||
}
|
}
|
||||||
|
|
||||||
for i, d := range data {
|
for i, d := range data {
|
||||||
|
Reference in New Issue
Block a user