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

Function TestIsPascalCase

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

Source from the content-addressed store, hash-verified

52}
53
54func TestIsPascalCase(t *testing.T) {
55 for _, tc := range []struct {
56 in string
57 want bool
58 }{
59 {"", true},
60 {"Feat", true},
61 {"MyFeature", true},
62 {"ParseHTML", true},
63 {"MyFeat123", true}, // digits ok
64 {"myFeature", false}, // starts lowercase
65 {"My-Feature", false}, // hyphen not allowed
66 {"My Feature", false}, // space not allowed
67 } {
68 got := casing.IsPascalCase(tc.in)
69 if got != tc.want {
70 t.Errorf("IsPascalCase(%q) = %v, want %v", tc.in, got, tc.want)
71 }
72 }
73}
74
75func TestIsSentenceCase(t *testing.T) {
76 for _, tc := range []struct {

Callers

nothing calls this directly

Calls 1

IsPascalCaseFunction · 0.92

Tested by

no test coverage detected