TestAllResources ensures that all resources have a unique type name.
(t *testing.T)
| 178 | |
| 179 | // TestAllResources ensures that all resources have a unique type name. |
| 180 | func TestAllResources(t *testing.T) { |
| 181 | t.Parallel() |
| 182 | |
| 183 | var typeNames []string |
| 184 | resources := rbac.AllResources() |
| 185 | for _, r := range resources { |
| 186 | if r.RBACObject().Type == "" { |
| 187 | t.Errorf("empty type name: %s", r.RBACObject().Type) |
| 188 | continue |
| 189 | } |
| 190 | if slice.Contains(typeNames, r.RBACObject().Type) { |
| 191 | t.Errorf("duplicate type name: %s", r.RBACObject().Type) |
| 192 | continue |
| 193 | } |
| 194 | typeNames = append(typeNames, r.RBACObject().Type) |
| 195 | } |
| 196 | } |
nothing calls this directly
no test coverage detected