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

Function TestHeaderTrim_TrailingSpace_Fail

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

Source from the content-addressed store, hash-verified

1173}
1174
1175func TestHeaderTrim_TrailingSpace_Fail(t *testing.T) {
1176 r := &rule.HeaderTrimRule{}
1177 if err := r.Apply(lint.RuleSetting{}); err != nil {
1178 t.Fatal(err)
1179 }
1180 _, ok := r.Validate(&mockCommit{header: "feat: add feature "})
1181 if ok {
1182 t.Error("header with trailing space should fail header-trim")
1183 }
1184}
1185
1186func TestHeaderTrim_BothSpaces_Fail(t *testing.T) {
1187 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