1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 07:57:07 +00:00
kyverno/pkg/utils/strings/join_test.go

15 lines
428 B
Go
Raw Normal View History

package strings
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestJoins(t *testing.T) {
assert.Equal(t, "test", JoinNonEmpty([]string{"test", ""}, ","))
assert.Equal(t, "test,test", JoinNonEmpty([]string{"test", "test"}, ","))
assert.Equal(t, "test; test", JoinNonEmpty([]string{"test", "", "test", ""}, "; "))
assert.Equal(t, "fi fo fum", JoinNonEmpty([]string{"", "fi", "", "fo", "", "fum"}, " "))
}