mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
15 lines
428 B
Go
15 lines
428 B
Go
|
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"}, " "))
|
||
|
}
|