(t *testing.T, e *CachedEnforcer, sub string, obj interface{}, act string, res bool)
| 17 | import "testing" |
| 18 | |
| 19 | func testEnforceCache(t *testing.T, e *CachedEnforcer, sub string, obj interface{}, act string, res bool) { |
| 20 | t.Helper() |
| 21 | if myRes, _ := e.Enforce(sub, obj, act); myRes != res { |
| 22 | t.Errorf("%s, %v, %s: %t, supposed to be %t", sub, obj, act, myRes, res) |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | func TestCache(t *testing.T) { |
| 27 | e, _ := NewCachedEnforcer("examples/basic_model.conf", "examples/basic_policy.csv") |