aboutsummaryrefslogtreecommitdiff
path: root/search
diff options
context:
space:
mode:
authorJulien Dessaux2025-02-25 22:24:38 +0100
committerJulien Dessaux2025-02-28 23:28:45 +0100
commit87c244c4f5e1c783a0d29c6fffe7c95f42884b7d (patch)
tree920f1737bc94a0760723f84aca87d1d5a8eca36a /search
parentchore(deps): update dependencies (diff)
downloadwww-87c244c4f5e1c783a0d29c6fffe7c95f42884b7d.tar.gz
www-87c244c4f5e1c783a0d29c6fffe7c95f42884b7d.tar.bz2
www-87c244c4f5e1c783a0d29c6fffe7c95f42884b7d.zip
chore(search): remove unnecessary dependency
Diffstat (limited to 'search')
-rw-r--r--search/go.mod8
-rw-r--r--search/go.sum10
-rw-r--r--search/search_test.go11
3 files changed, 7 insertions, 22 deletions
diff --git a/search/go.mod b/search/go.mod
index 12c7930..3b9bac1 100644
--- a/search/go.mod
+++ b/search/go.mod
@@ -1,11 +1,3 @@
module git.adyxax.org/adyxax/www/search
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
-)
diff --git a/search/go.sum b/search/go.sum
index 713a0b4..e69de29 100644
--- a/search/go.sum
+++ b/search/go.sum
@@ -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=
diff --git a/search/search_test.go b/search/search_test.go
index e7ce3bc..fcb2efb 100644
--- a/search/search_test.go
+++ b/search/search_test.go
@@ -1,9 +1,8 @@
package main
import (
+ "slices"
"testing"
-
- "github.com/stretchr/testify/require"
)
func TestNormalizeWords(t *testing.T) {
@@ -18,7 +17,9 @@ func TestNormalizeWords(t *testing.T) {
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
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 {
t.Run(tc.name, func(t *testing.T) {
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)
+ }
})
}
}