MCPcopy
hub / github.com/apache/casbin / testDomainEnforce

Function testDomainEnforce

model_test.go:42–49  ·  view source on GitHub ↗
(t *testing.T, e *Enforcer, sub string, dom string, obj string, act string, res bool)

Source from the content-addressed store, hash-verified

40}
41
42func 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
51func TestBasicModel(t *testing.T) {
52 e, _ := NewEnforcer("examples/basic_model.conf", "examples/basic_policy.csv")

Calls 1

EnforceMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…