MCPcopy Index your code
hub / github.com/conventionalcommit/commitlint / TestIsCamelCase

Function TestIsCamelCase

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

Source from the content-addressed store, hash-verified

7)
8
9func TestIsCamelCase(t *testing.T) {
10 for _, tc := range []struct {
11 in string
12 want bool
13 }{
14 {"", true}, // empty always passes
15 {"feat", true}, // all-lowercase single word
16 {"myFeature", true}, // classic camelCase
17 {"parseHTML", true}, // acronym tail is fine (still no separator)
18 {"myFeat123", true}, // digits allowed
19 {"MyFeature", false}, // starts uppercase → PascalCase, not camelCase
20 {"my-feature", false}, // hyphen not allowed
21 {"my_feature", false}, // underscore not allowed
22 {"my feature", false}, // space not allowed
23 } {
24 got := casing.IsCamelCase(tc.in)
25 if got != tc.want {
26 t.Errorf("IsCamelCase(%q) = %v, want %v", tc.in, got, tc.want)
27 }
28 }
29}
30
31func TestIsKebabCase(t *testing.T) {
32 for _, tc := range []struct {

Callers

nothing calls this directly

Calls 1

IsCamelCaseFunction · 0.92

Tested by

no test coverage detected