| 1106 | } |
| 1107 | |
| 1108 | func TestFooterLeadingBlank_WithBlank_Pass(t *testing.T) { |
| 1109 | r := &rule.FooterLeadingBlankRule{} |
| 1110 | if err := r.Apply(lint.RuleSetting{}); err != nil { |
| 1111 | t.Fatal(err) |
| 1112 | } |
| 1113 | msg := &mockCommit{ |
| 1114 | message: "feat: add feature\n\nbody text\n\nFixes: #123", |
| 1115 | footer: "Fixes: #123", |
| 1116 | } |
| 1117 | _, ok := r.Validate(msg) |
| 1118 | if !ok { |
| 1119 | t.Error("footer with leading blank should pass") |
| 1120 | } |
| 1121 | } |
| 1122 | |
| 1123 | func TestFooterLeadingBlank_WithoutBlank_Fail(t *testing.T) { |
| 1124 | r := &rule.FooterLeadingBlankRule{} |