--- Body length rules ---
(t *testing.T)
| 100 | // --- Body length rules --- |
| 101 | |
| 102 | func TestBodyMinLen_ZeroAllowsEmpty(t *testing.T) { |
| 103 | r := &rule.BodyMinLenRule{} |
| 104 | if err := r.Apply(lint.RuleSetting{Argument: 0}); err != nil { |
| 105 | t.Fatal(err) |
| 106 | } |
| 107 | _, ok := r.Validate(&mockCommit{body: ""}) |
| 108 | if !ok { |
| 109 | t.Error("empty body with min=0 should pass") |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | func TestBodyMinLen_Fail(t *testing.T) { |
| 114 | r := &rule.BodyMinLenRule{} |