model function unit tests!

This commit is contained in:
ari melody 2025-03-24 19:39:10 +00:00
parent e5ae167550
commit 6db35b2f99
Signed by: ari
GPG key ID: 60B5F0386E3DDB7E
9 changed files with 254 additions and 16 deletions

View file

@ -11,6 +11,6 @@ type Link struct {
}
func (link Link) NormaliseName() string {
rgx := regexp.MustCompile(`[^a-z0-9]`)
return strings.ToLower(rgx.ReplaceAllString(link.Name, ""))
rgx := regexp.MustCompile(`[^a-z0-9\-]`)
return rgx.ReplaceAllString(strings.ToLower(link.Name), "")
}