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

Function TestBodyMaxLen_Fail

test/rule_test.go:135–144  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

133}
134
135func TestBodyMaxLen_Fail(t *testing.T) {
136 r := &rule.BodyMaxLenRule{}
137 if err := r.Apply(lint.RuleSetting{Argument: 5}); err != nil {
138 t.Fatal(err)
139 }
140 _, ok := r.Validate(&mockCommit{body: "this body is too long"})
141 if ok {
142 t.Error("body > 5 should fail")
143 }
144}
145
146func TestBodyMaxLineLen_Pass(t *testing.T) {
147 r := &rule.BodyMaxLineLenRule{}

Callers

nothing calls this directly

Calls 3

ApplyMethod · 0.95
ValidateMethod · 0.95
ErrorMethod · 0.80

Tested by

no test coverage detected