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

Function TestHeadMinLen_Fail

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

Source from the content-addressed store, hash-verified

33}
34
35func TestHeadMinLen_Fail(t *testing.T) {
36 r := &rule.HeadMinLenRule{}
37 if err := r.Apply(lint.RuleSetting{Argument: 10}); err != nil {
38 t.Fatal(err)
39 }
40 issue, ok := r.Validate(&mockCommit{header: "short"})
41 if ok {
42 t.Error("header length < 10 should fail")
43 }
44 if issue == nil || issue.Description() == "" {
45 t.Error("expected non-empty issue description")
46 }
47}
48
49func TestHeadMinLen_BadArg(t *testing.T) {
50 r := &rule.HeadMinLenRule{}

Callers

nothing calls this directly

Calls 4

ApplyMethod · 0.95
ValidateMethod · 0.95
ErrorMethod · 0.80
DescriptionMethod · 0.65

Tested by

no test coverage detected