(t *testing.T)
| 122 | } |
| 123 | |
| 124 | func TestBodyMaxLen_NegativeDisables(t *testing.T) { |
| 125 | r := &rule.BodyMaxLenRule{} |
| 126 | if err := r.Apply(lint.RuleSetting{Argument: -1}); err != nil { |
| 127 | t.Fatal(err) |
| 128 | } |
| 129 | _, ok := r.Validate(&mockCommit{body: "very long body text here that would normally fail"}) |
| 130 | if !ok { |
| 131 | t.Error("max=-1 should disable check") |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | func TestBodyMaxLen_Fail(t *testing.T) { |
| 136 | r := &rule.BodyMaxLenRule{} |