(t *testing.T, e *SyncedEnforcer, sub string, obj interface{}, act string, res bool)
| 24 | ) |
| 25 | |
| 26 | func testEnforceSync(t *testing.T, e *SyncedEnforcer, sub string, obj interface{}, act string, res bool) { |
| 27 | t.Helper() |
| 28 | if myRes, _ := e.Enforce(sub, obj, act); myRes != res { |
| 29 | t.Errorf("%s, %v, %s: %t, supposed to be %t", sub, obj, act, myRes, res) |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | func TestSync(t *testing.T) { |
| 34 | e, _ := NewSyncedEnforcer("examples/basic_model.conf", "examples/basic_policy.csv") |