photoprism/pkg/list/remove_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
833 B
Go

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