diff options
author | spf13 <steve.francia@gmail.com> | 2014-11-04 20:19:45 -0500 |
---|---|---|
committer | spf13 <steve.francia@gmail.com> | 2014-11-04 20:19:45 -0500 |
commit | a40bd3caf16ecabc189dd6e676792555d175540b (patch) | |
tree | cdff36023ee3a5035124fb8673a5d6e8271b2222 /helpers/path_test.go | |
parent | e2634752ce7dcc2f6cf1902b0409206e0ed8a571 (diff) |
rewriting guessSection to accurately reflect intent and usage. Update tests.
Diffstat (limited to 'helpers/path_test.go')
-rw-r--r-- | helpers/path_test.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/helpers/path_test.go b/helpers/path_test.go index 607918581..bab1786e2 100644 --- a/helpers/path_test.go +++ b/helpers/path_test.go @@ -423,17 +423,20 @@ func TestGuessSection(t *testing.T) { {"", ""}, {"/content", ""}, {"content/", ""}, - {"/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", "blog"}, - {"content/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 { |