photoprism/pkg/sanitize/username_test.go

19 lines
387 B
Go

package sanitize
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestUsername(t *testing.T) {
t.Run("Admin ", func(t *testing.T) {
assert.Equal(t, "admin", Username("Admin "))
})
t.Run(" Admin ", func(t *testing.T) {
assert.Equal(t, "admin", Username(" Admin "))
})
t.Run(" admin ", func(t *testing.T) {
assert.Equal(t, "admin", Username(" admin "))
})
}