MCPcopy Index your code
hub / github.com/apache/casbin / testEnforceCache

Function testEnforceCache

enforcer_cached_test.go:19–24  ·  view source on GitHub ↗
(t *testing.T, e *CachedEnforcer, sub string, obj interface{}, act string, res bool)

Source from the content-addressed store, hash-verified

17import "testing"
18
19func 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
26func TestCache(t *testing.T) {
27 e, _ := NewCachedEnforcer("examples/basic_model.conf", "examples/basic_policy.csv")

Callers 1

TestCacheFunction · 0.85

Calls 1

EnforceMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…