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

Function TestHeaderTrim_BothSpaces_Fail

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

Source from the content-addressed store, hash-verified

1184}
1185
1186func TestHeaderTrim_BothSpaces_Fail(t *testing.T) {
1187 r := &rule.HeaderTrimRule{}
1188 if err := r.Apply(lint.RuleSetting{}); err != nil {
1189 t.Fatal(err)
1190 }
1191 _, ok := r.Validate(&mockCommit{header: " feat: add feature "})
1192 if ok {
1193 t.Error("header with both-sides whitespace should fail header-trim")
1194 }
1195}
1196
1197// ============================================================
1198// Signed-off-by and trailer-exists rules

Callers

nothing calls this directly

Calls 3

ApplyMethod · 0.95
ValidateMethod · 0.95
ErrorMethod · 0.80

Tested by

no test coverage detected