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

Function TestHeaderFullStop_CustomChar

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

Source from the content-addressed store, hash-verified

972}
973
974func TestHeaderFullStop_CustomChar(t *testing.T) {
975 r := &rule.HeaderFullStopRule{}
976 if err := r.Apply(lint.RuleSetting{Argument: "!"}); err != nil {
977 t.Fatal(err)
978 }
979 _, ok := r.Validate(&mockCommit{header: "feat: urgent!"})
980 if ok {
981 t.Error("header ending with '!' should fail")
982 }
983 _, ok2 := r.Validate(&mockCommit{header: "feat: normal"})
984 if !ok2 {
985 t.Error("header not ending with '!' should pass")
986 }
987}
988
989func TestHeaderFullStop_BadArg(t *testing.T) {
990 r := &rule.HeaderFullStopRule{}

Callers

nothing calls this directly

Calls 3

ApplyMethod · 0.95
ValidateMethod · 0.95
ErrorMethod · 0.80

Tested by

no test coverage detected