1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-01-20 18:52:16 +00:00
kyverno/pkg/utils/strings/join_test.go
Jim Bugwadia f287e0a220
Conditions message (#7113)
* add message to conditions

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* add tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* extend tests

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

---------

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2023-05-08 15:34:23 +08:00

14 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"}, " "))
}