Codespell: Fix invalid inline comments and broken test assertions #4506

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-03-27 16:57:56 +01:00
parent 15668ee7b5
commit ca708c3f56
5 changed files with 42 additions and 43 deletions

View File

@@ -30,7 +30,7 @@ func TestClip(t *testing.T) {
})
t.Run("ToASCII", func(t *testing.T) {
result := Clip(ToASCII(strings.ToLower(" 幸福 Hanzi are logograms developed for the writing of Chinese! Expressions in an index may not ...!")), ClipStringType)
assert.Equal(t, "hanzi are logograms developed for the writing of chinese! express", result)
assert.Equal(t, "hanzi are logograms developed for the writing of chinese! expres", result)
assert.Equal(t, 64, len(result))
})
t.Run("Empty", func(t *testing.T) {
@@ -42,12 +42,12 @@ func TestClip(t *testing.T) {
func TestSanitizeStringType(t *testing.T) {
result := SanitizeStringType(" 幸福 Hanzi are logograms developed for the writing of Chinese! Expressions in an index may not ...!")
assert.Equal(t, "Hanzi are logograms developed for the writing of Chinese! Expres", result)
assert.Equal(t, "Hanzi are logograms developed for the writing of Chinese! Expres", result) // codespell:ignore
assert.Equal(t, ClipStringType, len(result))
}
func TestSanitizeStringTypeLower(t *testing.T) {
result := SanitizeStringTypeLower(" 幸福 Hanzi are logograms developed for the writing of Chinese! Expressions in an index may not ...!")
assert.Equal(t, "hanzi are logograms developed for the writing of chinese! express", result)
assert.Equal(t, "hanzi are logograms developed for the writing of chinese! expres", result) // codespell:ignore
assert.Equal(t, ClipStringType, len(result))
}