(t *testing.T)
| 365 | } |
| 366 | |
| 367 | func TestScopeEnum_EmptyAllowed(t *testing.T) { |
| 368 | r := &rule.ScopeEnumRule{} |
| 369 | if err := r.Apply(lint.RuleSetting{ |
| 370 | Argument: []interface{}{"auth"}, |
| 371 | Flags: map[string]interface{}{"allow-empty": true}, |
| 372 | }); err != nil { |
| 373 | t.Fatal(err) |
| 374 | } |
| 375 | _, ok := r.Validate(&mockCommit{scope: ""}) |
| 376 | if !ok { |
| 377 | t.Error("empty scope with allow-empty=true should pass") |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | func TestScopeEnum_EmptyNotAllowed(t *testing.T) { |
| 382 | r := &rule.ScopeEnumRule{} |