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

Function TestHeadMaxLen_Fail

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

Source from the content-addressed store, hash-verified

76}
77
78func TestHeadMaxLen_Fail(t *testing.T) {
79 r := &rule.HeadMaxLenRule{}
80 if err := r.Apply(lint.RuleSetting{Argument: 10}); err != nil {
81 t.Fatal(err)
82 }
83 _, ok := r.Validate(&mockCommit{header: "this header is way too long"})
84 if ok {
85 t.Error("header > 10 should fail")
86 }
87}
88
89func TestHeadMaxLen_NegativeDisables(t *testing.T) {
90 r := &rule.HeadMaxLenRule{}

Callers

nothing calls this directly

Calls 3

ApplyMethod · 0.95
ValidateMethod · 0.95
ErrorMethod · 0.80

Tested by

no test coverage detected