(t *testing.T)
| 54 | } |
| 55 | |
| 56 | func TestHeadMaxLen_Pass(t *testing.T) { |
| 57 | r := &rule.HeadMaxLenRule{} |
| 58 | if err := r.Apply(lint.RuleSetting{Argument: 50}); err != nil { |
| 59 | t.Fatal(err) |
| 60 | } |
| 61 | _, ok := r.Validate(&mockCommit{header: "feat: short"}) |
| 62 | if !ok { |
| 63 | t.Error("header <= 50 should pass") |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | func TestHeadMaxLen_Exact(t *testing.T) { |
| 68 | r := &rule.HeadMaxLenRule{} |