photoprism/pkg/clean/unicode_test.go
Michael Mayer ae130dc500 Metadata: Sanitize bad Unicode strings #2897
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-11-15 14:45:21 +01:00

16 lines
388 B
Go

package clean
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestUnicode(t *testing.T) {
t.Run("Valid", func(t *testing.T) {
assert.Equal(t, "Naïve bonds and futures surge as inflation eases 🚀🚀🚀", Unicode("Naïve bonds and futures surge as inflation eases 🚀🚀🚀"))
})
t.Run("Empty", func(t *testing.T) {
assert.Equal(t, "", Unicode(""))
})
}