(t *testing.T)
| 428 | } |
| 429 | |
| 430 | func TestPolicyAndRuleSemanticMethods(t *testing.T) { |
| 431 | p := NewPolicy(nil, nil) |
| 432 | if p.Semantic() != firstMatch { |
| 433 | t.Errorf("got %v, wanted firstMatch", p.Semantic()) |
| 434 | } |
| 435 | p.SetSemantic(aggregate) |
| 436 | if p.Semantic() != aggregate { |
| 437 | t.Errorf("got %v, wanted aggregate", p.Semantic()) |
| 438 | } |
| 439 | // Attempt to set conflicting semantic |
| 440 | p.SetSemantic(firstMatch) |
| 441 | if p.Semantic() != aggregate { |
| 442 | t.Errorf("got %v, wanted aggregate after conflicting SetSemantic", p.Semantic()) |
| 443 | } |
| 444 | |
| 445 | r := NewRule(123) |
| 446 | if r.SourceID() != 123 { |
| 447 | t.Errorf("got %v, wanted 123", r.SourceID()) |
| 448 | } |
| 449 | if r.Semantic() != firstMatch { |
| 450 | t.Errorf("got %v, wanted firstMatch", r.Semantic()) |
| 451 | } |
| 452 | r.SetSemantic(aggregate) |
| 453 | if r.Semantic() != aggregate { |
| 454 | t.Errorf("got %v, wanted aggregate", r.Semantic()) |
| 455 | } |
| 456 | // Attempt to set conflicting semantic |
| 457 | r.SetSemantic(firstMatch) |
| 458 | if r.Semantic() != aggregate { |
| 459 | t.Errorf("got %v, wanted aggregate after conflicting SetSemantic", r.Semantic()) |
| 460 | } |
| 461 | } |
nothing calls this directly
no test coverage detected