photoprism/pkg/list/add_test.go
Michael Mayer 884dea17de Security: Use individual preview tokens for each user account #98
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-10-13 22:11:02 +02:00

19 lines
852 B
Go

package list
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestAdd(t *testing.T) {
assert.Equal(t, []string{}, Add([]string{}, ""))
assert.Equal(t, []string{"bar"}, Add([]string{}, "bar"))
assert.Equal(t, []string{"foo", "bar"}, Add([]string{"foo", "bar"}, ""))
assert.Equal(t, []string{"foo", "bar"}, Add([]string{"foo", "bar"}, "foo"))
assert.Equal(t, []string{"foo", "bar", "zzz"}, Add([]string{"foo", "bar"}, "zzz"))
assert.Equal(t, []string{"foo", "bar", " "}, Add([]string{"foo", "bar"}, " "))
assert.Equal(t, []string{"foo", "bar", "645656"}, Add([]string{"foo", "bar"}, "645656"))
assert.Equal(t, []string{"foo", "bar ", "foo ", "baz", "bar"}, Add([]string{"foo", "bar ", "foo ", "baz"}, "bar"))
assert.Equal(t, []string{"foo", "bar", "foo ", "baz", "bar "}, Add([]string{"foo", "bar", "foo ", "baz"}, "bar "))
}