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

Function testBatchEnforce

enforcer_test.go:493–504  ·  view source on GitHub ↗
(t *testing.T, e *Enforcer, requests [][]interface{}, results []bool)

Source from the content-addressed store, hash-verified

491}
492
493func testBatchEnforce(t *testing.T, e *Enforcer, requests [][]interface{}, results []bool) {
494 t.Helper()
495 myRes, _ := e.BatchEnforce(requests)
496 if len(myRes) != len(results) {
497 t.Errorf("%v supposed to be %v", myRes, results)
498 }
499 for i, v := range myRes {
500 if v != results[i] {
501 t.Errorf("%v supposed to be %v", myRes, results)
502 }
503 }
504}
505
506func TestBatchEnforce(t *testing.T) {
507 e, _ := NewEnforcer("examples/basic_model.conf", "examples/basic_policy.csv")

Callers 6

TestBatchEnforceFunction · 0.85
TestSubjectPriorityFunction · 0.85
TestPriorityExplicitFunction · 0.85

Calls 1

BatchEnforceMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…