Closed Redlinkk closed 2 years ago
Merging #74 (c05c02d) into master (452645f) will not change coverage. The diff coverage is
100.00%
.
Hello, sorry it took me so long to review it (burn out issues).
I improved tests to have more edge cases like this and rebased with master
branch.
Looks like when fixing this problem you introduced another one: now it's cutting word that should not be cut.
Thank you for catching this. I will wait with releasing new version until this is merged.
--- FAIL: TestSlugMakeSmartTruncate (0.00s)
slug_test.go:327: 4. MaxLength = 16; Make("Dobroslaw Zybort") = "dobroslaw"; want "dobroslaw-zybort"
slug_test.go:327: 13. MaxLength = 6; Make("abc-de") = "abc"; want "abc-de"
slug_test.go:327: 15. MaxLength = 6; Make("abc-de-fg") = "abc"; want "abc-de"
slug_test.go:327: 18. MaxLength = 9; Make("abc-de-fg") = "abc-de"; want "abc-de-fg"
FAIL
Fixes https://github.com/gosimple/slug/issues/72
I'm not using operations on strings to avoid unnecessary allocations. I've added a test case for the fixed issue.