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

Function testRuleCount

persist/persist_test.go:29–36  ·  view source on GitHub ↗
(t *testing.T, model model.Model, expected int, sec string, ptype string, tag string)

Source from the content-addressed store, hash-verified

27}
28
29func testRuleCount(t *testing.T, model model.Model, expected int, sec string, ptype string, tag string) {
30 t.Helper()
31
32 ruleCount := len(model[sec][ptype].Policy)
33 if ruleCount != expected {
34 t.Errorf("[%s] rule count: %d, expected %d", tag, ruleCount, expected)
35 }
36}
37
38func TestDuplicateRuleInAdapter(t *testing.T) {
39 e, _ := casbin.NewEnforcer("../examples/basic_model.conf")

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…