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

Function testEnforceSync

enforcer_synced_test.go:26–31  ·  view source on GitHub ↗
(t *testing.T, e *SyncedEnforcer, sub string, obj interface{}, act string, res bool)

Source from the content-addressed store, hash-verified

24)
25
26func 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
33func TestSync(t *testing.T) {
34 e, _ := NewSyncedEnforcer("examples/basic_model.conf", "examples/basic_policy.csv")

Callers 1

TestSyncFunction · 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…