(t *testing.T, e *Enforcer, sub string, subConf, subInteg float64, obj string, objConf, objInteg float64, act string, res bool)
| 19 | ) |
| 20 | |
| 21 | func testEnforceLBAC(t *testing.T, e *Enforcer, sub string, subConf, subInteg float64, obj string, objConf, objInteg float64, act string, res bool) { |
| 22 | t.Helper() |
| 23 | if myRes, err := e.Enforce(sub, subConf, subInteg, obj, objConf, objInteg, act); err != nil { |
| 24 | t.Errorf("Enforce Error: %s", err) |
| 25 | } else if myRes != res { |
| 26 | t.Errorf("%s, conf=%v, integ=%v, %s, conf=%v, integ=%v, %s: %t, supposed to be %t", sub, subConf, subInteg, obj, objConf, objInteg, act, myRes, res) |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | func TestLBACModel(t *testing.T) { |
| 31 | e, _ := NewEnforcer("examples/lbac_model.conf") |
no test coverage detected
searching dependent graphs…