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

Function TestBodyMinLen_ZeroAllowsEmpty

test/rule_test.go:102–111  ·  view source on GitHub ↗

--- Body length rules ---

(t *testing.T)

Source from the content-addressed store, hash-verified

100// --- Body length rules ---
101
102func TestBodyMinLen_ZeroAllowsEmpty(t *testing.T) {
103 r := &rule.BodyMinLenRule{}
104 if err := r.Apply(lint.RuleSetting{Argument: 0}); err != nil {
105 t.Fatal(err)
106 }
107 _, ok := r.Validate(&mockCommit{body: ""})
108 if !ok {
109 t.Error("empty body with min=0 should pass")
110 }
111}
112
113func TestBodyMinLen_Fail(t *testing.T) {
114 r := &rule.BodyMinLenRule{}

Callers

nothing calls this directly

Calls 3

ApplyMethod · 0.95
ValidateMethod · 0.95
ErrorMethod · 0.80

Tested by

no test coverage detected