github.com/bingoohuang/gg@v0.0.0-20240325092523-45da7dee9335/pkg/ss/s_test.go (about) 1 package ss 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 ) 8 9 func TestToLowerKebab(t *testing.T) { 10 assert.Equal(t, "abc", ToLowerKebab("ABC")) 11 assert.Equal(t, "hello-world", ToLowerKebab("hello-world")) 12 assert.Equal(t, "hello-world", ToLowerKebab("HelloWorld")) 13 assert.Equal(t, "hello-url", ToLowerKebab("HelloURL")) 14 assert.Equal(t, "hello-url-addr", ToLowerKebab("HelloURLAddr")) 15 } 16 17 func TestSplit(t *testing.T) { 18 assert.Equal(t, []string{"a", "b"}, Split(",a,b,")) 19 assert.Len(t, Split(""), 0) 20 }