Extract conditional branch to function

This commit is contained in:
Dennis Verheijden
2025-09-11 13:35:50 +02:00
committed by Manuel Rüger
parent 2173fbcfcd
commit 6d81045bf0
2 changed files with 14 additions and 2 deletions

View File

@@ -28,3 +28,11 @@ func TestExtractDocumentLeadingH1(t *testing.T) {
assert.Equal(t, "a", actual)
}
func TestSetTitleFromFilename(t *testing.T) {
t.Run("set title from filename", func(t *testing.T) {
meta := &Meta{Title: ""}
setTitleFromFilename(meta, "/path/to/test.md")
assert.Equal(t, "test", meta.Title)
})
}