diff options
Diffstat (limited to 'helpers/path_test.go')
-rw-r--r-- | helpers/path_test.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/helpers/path_test.go b/helpers/path_test.go index 8d895d762..bb5125034 100644 --- a/helpers/path_test.go +++ b/helpers/path_test.go @@ -638,40 +638,6 @@ func TestFileAndExt(t *testing.T) { } -func TestGuessSection(t *testing.T) { - type test struct { - input, expected string - } - - data := []test{ - {"/", ""}, - {"", ""}, - {"/content", ""}, - {"content/", ""}, - {"/content/", ""}, // /content/ is a special case. It will never be the section - {"/blog", ""}, - {"/blog/", "blog"}, - {"blog", ""}, - {"content/blog", ""}, - {"/content/blog/", "blog"}, - {"/content/blog", ""}, // Lack of trailing slash indicates 'blog' is not a directory. - {"content/blog/", "blog"}, - {"/contents/myblog/", "contents"}, - {"/contents/yourblog", "contents"}, - {"/contents/ourblog/", "contents"}, - {"/content/myblog/", "myblog"}, - {"/content/yourblog", ""}, - {"/content/ourblog/", "ourblog"}, - } - - for i, d := range data { - expected := GuessSection(filepath.FromSlash(d.input)) - if d.expected != expected { - t.Errorf("Test %d failed. Expected %q got %q", i, d.expected, expected) - } - } -} - func TestPathPrep(t *testing.T) { } |