| 783 | } |
| 784 | |
| 785 | func 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 | |
| 797 | func TestBodyCaseRule_MultiLine_BlankLineSkipped(t *testing.T) { |
| 798 | r := &rule.BodyCaseRule{} |