MCPcopy Create free account
hub / github.com/conventionalcommit/commitlint / TestIsStartCase

Function TestIsStartCase

internal/casing/casing_test.go:117–135  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

115}
116
117func TestIsStartCase(t *testing.T) {
118 for _, tc := range []struct {
119 in string
120 want bool
121 }{
122 {"", true},
123 {"Feat", true},
124 {"My Feature", true},
125 {"Add New Endpoint", true},
126 {"my feature", false}, // first word lowercase
127 {"My feature", false}, // second word lowercase
128 {"MY FEATURE", true}, // all-uppercase still starts uppercase per word
129 } {
130 got := casing.IsStartCase(tc.in)
131 if got != tc.want {
132 t.Errorf("IsStartCase(%q) = %v, want %v", tc.in, got, tc.want)
133 }
134 }
135}
136
137func TestCheck_AllFormats(t *testing.T) {
138 for _, tc := range []struct {

Callers

nothing calls this directly

Calls 1

IsStartCaseFunction · 0.92

Tested by

no test coverage detected