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

Function TestBodyCaseRule_MultiLine_SomeFail

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

Source from the content-addressed store, hash-verified

783}
784
785func TestBodyCaseRule_MultiLine_SomeFail(t *testing.T) {
786 r := &rule.BodyCaseRule{}
787 if err := r.Apply(lint.RuleSetting{Argument: casing.Lower}); err != nil {
788 t.Fatal(err)
789 }
790 // Whole body contains uppercase, so the entire body fails
791 _, ok := r.Validate(&mockCommit{body: "first line is good\nSecond line is bad"})
792 if ok {
793 t.Error("body containing an uppercase letter should fail lower-case rule")
794 }
795}
796
797func TestBodyCaseRule_MultiLine_BlankLineSkipped(t *testing.T) {
798 r := &rule.BodyCaseRule{}

Callers

nothing calls this directly

Calls 3

ApplyMethod · 0.95
ValidateMethod · 0.95
ErrorMethod · 0.80

Tested by

no test coverage detected