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

Function TestHeaderTrim_LeadingSpace_Fail

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

Source from the content-addressed store, hash-verified

1162}
1163
1164func TestHeaderTrim_LeadingSpace_Fail(t *testing.T) {
1165 r := &rule.HeaderTrimRule{}
1166 if err := r.Apply(lint.RuleSetting{}); err != nil {
1167 t.Fatal(err)
1168 }
1169 _, ok := r.Validate(&mockCommit{header: " feat: add feature"})
1170 if ok {
1171 t.Error("header with leading space should fail header-trim")
1172 }
1173}
1174
1175func TestHeaderTrim_TrailingSpace_Fail(t *testing.T) {
1176 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