(t *testing.T)
| 309 | } |
| 310 | |
| 311 | func TestMatchingFuncOrder(t *testing.T) { |
| 312 | rm := NewRoleManager(10) |
| 313 | rm.AddMatchingFunc("regexMatch", util.RegexMatch) |
| 314 | |
| 315 | _ = rm.AddLink("g\\d+", "root") |
| 316 | _ = rm.AddLink("u1", "g1") |
| 317 | testRole(t, rm, "u1", "root", true) |
| 318 | |
| 319 | _ = rm.Clear() |
| 320 | |
| 321 | _ = rm.AddLink("u1", "g1") |
| 322 | _ = rm.AddLink("g\\d+", "root") |
| 323 | testRole(t, rm, "u1", "root", true) |
| 324 | |
| 325 | _ = rm.Clear() |
| 326 | |
| 327 | _ = rm.AddLink("u1", "g\\d+") |
| 328 | testRole(t, rm, "u1", "g1", true) |
| 329 | testRole(t, rm, "u1", "g2", true) |
| 330 | } |
| 331 | |
| 332 | func TestDomainMatchingFuncWithDifferentDomain(t *testing.T) { |
| 333 | rm := NewRoleManager(10) |
nothing calls this directly
no test coverage detected
searching dependent graphs…