aboutsummaryrefslogtreecommitdiffhomepage
path: root/common/paths/pathparser_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'common/paths/pathparser_test.go')
-rw-r--r--common/paths/pathparser_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/common/paths/pathparser_test.go b/common/paths/pathparser_test.go
index 8c89ddd41..e8fee96e1 100644
--- a/common/paths/pathparser_test.go
+++ b/common/paths/pathparser_test.go
@@ -27,6 +27,9 @@ var testParser = &PathParser{
"no": 0,
"en": 1,
},
+ IsContentExt: func(ext string) bool {
+ return ext == "md"
+ },
}
func TestParse(t *testing.T) {
@@ -333,6 +336,22 @@ func TestParse(t *testing.T) {
c.Assert(p.Path(), qt.Equals, "/a/b/c.txt")
},
},
+ {
+ "Content data file gotmpl",
+ "/a/b/_content.gotmpl",
+ func(c *qt.C, p *Path) {
+ c.Assert(p.Path(), qt.Equals, "/a/b/_content.gotmpl")
+ c.Assert(p.Ext(), qt.Equals, "gotmpl")
+ c.Assert(p.IsContentData(), qt.IsTrue)
+ },
+ },
+ {
+ "Content data file yaml",
+ "/a/b/_content.yaml",
+ func(c *qt.C, p *Path) {
+ c.Assert(p.IsContentData(), qt.IsFalse)
+ },
+ },
}
for _, test := range tests {
c.Run(test.name, func(c *qt.C) {