(t *testing.T, e *Enforcer, sub string, dom string, obj string, act string, res bool)
| 40 | } |
| 41 | |
| 42 | func testDomainEnforce(t *testing.T, e *Enforcer, sub string, dom string, obj string, act string, res bool) { |
| 43 | t.Helper() |
| 44 | if myRes, err := e.Enforce(sub, dom, obj, act); err != nil { |
| 45 | t.Errorf("Enforce Error: %s", err) |
| 46 | } else if myRes != res { |
| 47 | t.Errorf("%s, %s, %s, %s: %t, supposed to be %t", sub, dom, obj, act, myRes, res) |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | func TestBasicModel(t *testing.T) { |
| 52 | e, _ := NewEnforcer("examples/basic_model.conf", "examples/basic_policy.csv") |
no test coverage detected
searching dependent graphs…