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

Function TestIsSnakeCase

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

Source from the content-addressed store, hash-verified

94}
95
96func TestIsSnakeCase(t *testing.T) {
97 for _, tc := range []struct {
98 in string
99 want bool
100 }{
101 {"", true},
102 {"feat", true},
103 {"my_feature", true},
104 {"snake_case", true},
105 {"v2_api", true}, // digit allowed
106 {"MyFeature", false}, // uppercase
107 {"my-feature", false}, // hyphen
108 {"my feature", false}, // space
109 } {
110 got := casing.IsSnakeCase(tc.in)
111 if got != tc.want {
112 t.Errorf("IsSnakeCase(%q) = %v, want %v", tc.in, got, tc.want)
113 }
114 }
115}
116
117func TestIsStartCase(t *testing.T) {
118 for _, tc := range []struct {

Callers

nothing calls this directly

Calls 1

IsSnakeCaseFunction · 0.92

Tested by

no test coverage detected