(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestIsUnauthorizedError(t *testing.T) { |
| 13 | t.Parallel() |
| 14 | t.Run("NotWrapped", func(t *testing.T) { |
| 15 | t.Parallel() |
| 16 | errFunc := func() error { |
| 17 | return rbac.UnauthorizedError{} |
| 18 | } |
| 19 | |
| 20 | err := errFunc() |
| 21 | require.True(t, rbac.IsUnauthorizedError(err)) |
| 22 | }) |
| 23 | |
| 24 | t.Run("Wrapped", func(t *testing.T) { |
| 25 | t.Parallel() |
| 26 | errFunc := func() error { |
| 27 | return xerrors.Errorf("test error: %w", rbac.UnauthorizedError{}) |
| 28 | } |
| 29 | err := errFunc() |
| 30 | require.True(t, rbac.IsUnauthorizedError(err)) |
| 31 | }) |
| 32 | } |
nothing calls this directly
no test coverage detected