photoprism/pkg/txt/clip_test.go
Michael Mayer 1cbb0a6d56 Labels: Edit name in overview #212
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-02-02 02:00:47 +01:00

20 lines
406 B
Go

package txt
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestClip(t *testing.T) {
t.Run("clip", func(t *testing.T) {
assert.Equal(t, "I'm ä", Clip("I'm ä lazy BRoWN fox!", 6))
})
t.Run("ok", func(t *testing.T) {
assert.Equal(t, "I'm ä lazy BRoWN fox!", Clip("I'm ä lazy BRoWN fox!", 128))
})
t.Run("empty", func(t *testing.T) {
assert.Equal(t, "", Clip("", -1))
})
}