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

Function TestIsSentenceCase

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

Source from the content-addressed store, hash-verified

73}
74
75func TestIsSentenceCase(t *testing.T) {
76 for _, tc := range []struct {
77 in string
78 want bool
79 }{
80 {"", true},
81 {"Feat", true},
82 {"My feature", true},
83 {"Add endpoint", true},
84 {"Fix #123", true}, // punctuation and digit allowed
85 {"feat", false}, // starts lowercase
86 {"My Feature", false}, // second word capitalised
87 {"MY FEATURE", false}, // fully uppercased
88 } {
89 got := casing.IsSentenceCase(tc.in)
90 if got != tc.want {
91 t.Errorf("IsSentenceCase(%q) = %v, want %v", tc.in, got, tc.want)
92 }
93 }
94}
95
96func TestIsSnakeCase(t *testing.T) {
97 for _, tc := range []struct {

Callers

nothing calls this directly

Calls 1

IsSentenceCaseFunction · 0.92

Tested by

no test coverage detected