(t *testing.T)
| 770 | } |
| 771 | |
| 772 | func TestEnforcerSetDetector(t *testing.T) { |
| 773 | // Test SetDetector() method |
| 774 | e, _ := NewEnforcer("examples/rbac_model.conf", "examples/rbac_policy.csv") |
| 775 | |
| 776 | // Create a custom detector |
| 777 | customDetector := detector.NewDefaultDetector() |
| 778 | e.SetDetector(customDetector) |
| 779 | |
| 780 | // Should still work with custom detector |
| 781 | err := e.RunDetections() |
| 782 | if err != nil { |
| 783 | t.Errorf("Expected no error with custom detector, but got: %v", err) |
| 784 | } |
| 785 | } |
| 786 | |
| 787 | func TestEnforcerSetDetectors(t *testing.T) { |
| 788 | // Test SetDetectors() method |
nothing calls this directly
no test coverage detected
searching dependent graphs…