photoprism/pkg/txt/separator_test.go

35 lines
807 B
Go
Raw Normal View History

package txt
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestIsSeparator(t *testing.T) {
t.Run("rune A", func(t *testing.T) {
assert.Equal(t, false, isSeparator('A'))
})
t.Run("rune 99", func(t *testing.T) {
assert.Equal(t, false, isSeparator('9'))
})
t.Run("rune /", func(t *testing.T) {
assert.Equal(t, true, isSeparator('/'))
})
t.Run("rune \\", func(t *testing.T) {
assert.Equal(t, true, isSeparator('\\'))
})
t.Run("rune ♥ ", func(t *testing.T) {
assert.Equal(t, false, isSeparator('♥'))
})
t.Run("rune space", func(t *testing.T) {
assert.Equal(t, true, isSeparator(' '))
})
t.Run("rune '", func(t *testing.T) {
assert.Equal(t, false, isSeparator('\''))
})
t.Run("rune ý", func(t *testing.T) {
assert.Equal(t, false, isSeparator('ý'))
})
}