diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-27 20:03:06 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-27 21:13:34 +0300 |
commit | 4eb2fec67c3a72a3ac98aa834dc56fd4504626d8 (patch) | |
tree | 80cfebc9fdc0e488b72e6ae2f3a6958953d0c2a1 /source/fileInfo_test.go | |
parent | 83c761b71a980aee6331179b271c7e24e999e8eb (diff) |
Fix handling of top-level page bundles
Fixes #4332
Diffstat (limited to 'source/fileInfo_test.go')
-rw-r--r-- | source/fileInfo_test.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/fileInfo_test.go b/source/fileInfo_test.go index 8ce8c16ef..1b9b130e4 100644 --- a/source/fileInfo_test.go +++ b/source/fileInfo_test.go @@ -34,10 +34,15 @@ func TestFileInfo(t *testing.T) { assert.Equal(filepath.FromSlash("/a/b/page.md"), f.Filename()) assert.Equal(filepath.FromSlash("b/"), f.Dir()) assert.Equal(filepath.FromSlash("b/page.md"), f.Path()) + assert.Equal("b", f.Section()) + + }}, + {filepath.FromSlash("/a/"), filepath.FromSlash("/a/b/c/d/page.md"), func(f *FileInfo) { + assert.Equal("b", f.Section()) }}, } { - f := s.NewFileInfo(this.base, this.filename, nil) + f := s.NewFileInfo(this.base, this.filename, false, nil) this.assert(f) } |