chore(search): remove unnecessary dependency

This commit is contained in:
Julien Dessaux 2025-02-25 22:24:38 +01:00
parent 1db6c64665
commit 87c244c4f5
Signed by: adyxax
GPG key ID: F92E51B86E07177E
3 changed files with 7 additions and 22 deletions

View file

@ -1,11 +1,3 @@
module git.adyxax.org/adyxax/www/search module git.adyxax.org/adyxax/www/search
go 1.23.6 go 1.23.6
require github.com/stretchr/testify v1.10.0
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

View file

@ -1,10 +0,0 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View file

@ -1,9 +1,8 @@
package main package main
import ( import (
"slices"
"testing" "testing"
"github.com/stretchr/testify/require"
) )
func TestNormalizeWords(t *testing.T) { func TestNormalizeWords(t *testing.T) {
@ -18,7 +17,9 @@ func TestNormalizeWords(t *testing.T) {
for _, tc := range testCases { for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) { t.Run(tc.name, func(t *testing.T) {
valid := normalizeWords(tc.input) valid := normalizeWords(tc.input)
require.Equal(t, tc.expected, valid) if slices.Compare(valid, tc.expected) != 0 {
t.Errorf("got %v, want %v", valid, tc.expected)
}
}) })
} }
} }
@ -37,7 +38,9 @@ func TestScoreIndex(t *testing.T) {
for _, tc := range testCases { for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) { t.Run(tc.name, func(t *testing.T) {
valid := scoreIndex(tc.input, tc.index) valid := scoreIndex(tc.input, tc.index)
require.Equal(t, tc.expected, valid) if valid != tc.expected {
t.Errorf("got %v, want %v", valid, tc.expected)
}
}) })
} }
} }