navidrome/persistence/sql_search_test.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
855 B
Go
Raw Normal View History

package persistence
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("sqlRepository", func() {
Describe("getFullText", func() {
It("returns all lowercase chars", func() {
2020-04-20 04:40:24 +02:00
Expect(getFullText("Some Text")).To(Equal(" some text"))
})
It("removes accents", func() {
2020-04-20 04:40:24 +02:00
Expect(getFullText("Quintão")).To(Equal(" quintao"))
})
It("remove extra spaces", func() {
2020-04-20 04:40:24 +02:00
Expect(getFullText(" some text ")).To(Equal(" some text"))
})
It("remove duplicated words", func() {
2020-04-20 04:40:24 +02:00
Expect(getFullText("legião urbana urbana legiÃo")).To(Equal(" legiao urbana"))
})
It("remove symbols", func() {
Expect(getFullText("Toms Diner ' “40” A")).To(Equal(" 40 a diner toms"))
})
2020-05-25 17:05:30 +02:00
It("remove opening brackets", func() {
Expect(getFullText("[Five Years]")).To(Equal(" five years"))
})
})
})