MCPcopy Create free account
hub / github.com/algolia/cli / TestToKebabCase

Function TestToKebabCase

pkg/utils/utils_test.go:89–122  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

87}
88
89func TestToKebabCase(t *testing.T) {
90 tests := []struct {
91 name string
92 input string
93 expected string
94 }{
95 {
96 name: "full lowercase",
97 input: "iaminlowercase",
98 expected: "iaminlowercase",
99 },
100 {
101 name: "full uppercase",
102 input: "IAMINUPPERCASE",
103 expected: "iaminuppercase",
104 },
105 {
106 name: "camelCase",
107 input: "camelCase",
108 expected: "camel-case",
109 },
110 {
111 name: "PascalCase",
112 input: "PascalCase",
113 expected: "pascal-case",
114 },
115 }
116
117 for _, tt := range tests {
118 t.Run(tt.name, func(t *testing.T) {
119 assert.Equal(t, tt.expected, ToKebabCase(tt.input))
120 })
121 }
122}
123
124func TestStringToSlice(t *testing.T) {
125 tests := []struct {

Callers

nothing calls this directly

Calls 2

ToKebabCaseFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected