| 771 | } |
| 772 | |
| 773 | func TestBodyCaseRule_MultiLine_AllFail(t *testing.T) { |
| 774 | r := &rule.BodyCaseRule{} |
| 775 | if err := r.Apply(lint.RuleSetting{Argument: casing.Lower}); err != nil { |
| 776 | t.Fatal(err) |
| 777 | } |
| 778 | // Entire body fails lower-case (uppercase letters present) |
| 779 | _, ok := r.Validate(&mockCommit{body: "First line capitalized\nSecond line capitalized"}) |
| 780 | if ok { |
| 781 | t.Error("body with uppercase letters should fail lower-case rule") |
| 782 | } |
| 783 | } |
| 784 | |
| 785 | func TestBodyCaseRule_MultiLine_SomeFail(t *testing.T) { |
| 786 | r := &rule.BodyCaseRule{} |