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

Function TestHeaderTrim_Clean_Pass

test/rule_test.go:1153–1162  ·  view source on GitHub ↗

============================================================ Header-trim rule ============================================================

(t *testing.T)

Source from the content-addressed store, hash-verified

1151// ============================================================
1152
1153func TestHeaderTrim_Clean_Pass(t *testing.T) {
1154 r := &rule.HeaderTrimRule{}
1155 if err := r.Apply(lint.RuleSetting{}); err != nil {
1156 t.Fatal(err)
1157 }
1158 _, ok := r.Validate(&mockCommit{header: "feat: add feature"})
1159 if !ok {
1160 t.Error("clean header should pass header-trim")
1161 }
1162}
1163
1164func TestHeaderTrim_LeadingSpace_Fail(t *testing.T) {
1165 r := &rule.HeaderTrimRule{}

Callers

nothing calls this directly

Calls 3

ApplyMethod · 0.95
ValidateMethod · 0.95
ErrorMethod · 0.80

Tested by

no test coverage detected