test(readertest): classify the invalid-argument domain errors in the reader comparison
- commit
- 9de0f7dfc0cc1fb8a371e1db1a327390c5a174a4
- author
- brice · · 2026-10-11 02:08 UTC
- parent
- 7b4c456
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +11 -1
M internal/readertest/compare.go +11 -1
| @@ -52,10 +52,20 @@ func errClass(err error) string { | |||
| 52 | 52 | return "invalid page size" | |
| 53 | 53 | case errors.Is(err, domain.ErrInvalidPath): | |
| 54 | 54 | return "invalid path" | |
| 55 | + | case errors.Is(err, domain.ErrInvalidObjectID): | |
| 56 | + | return "invalid object id" | |
| 57 | + | case errors.Is(err, domain.ErrInvalidRevision): | |
| 58 | + | return "invalid revision" | |
| 59 | + | case errors.Is(err, domain.ErrInvalidPageToken): | |
| 60 | + | return "invalid page token" | |
| 61 | + | case errors.Is(err, domain.ErrInvalidRefKind): | |
| 62 | + | return "invalid ref kind" | |
| 63 | + | case errors.Is(err, domain.ErrInvalid): | |
| 64 | + | return "invalid argument" | |
| 55 | 65 | case errors.Is(err, context.Canceled): | |
| 56 | 66 | return "canceled" | |
| 57 | 67 | } | |
| 58 | - | return "other" // the messages of two readers differ | |
| 68 | + | return "other" // outside the domain errors: the messages of two readers differ | |
| 59 | 69 | } | |
| 60 | 70 | ||
| 61 | 71 | // Queries are the questions put to both readers about one repository. | |
| @@ -52,10 +52,20 @@ func errClass(err error) string { | |||||
| 52 | return "invalid page size" | 52 | return "invalid page size" | ||
| 53 | case errors.Is(err, domain.ErrInvalidPath): | 53 | case errors.Is(err, domain.ErrInvalidPath): | ||
| 54 | return "invalid path" | 54 | return "invalid path" | ||
| 55 | + | case errors.Is(err, domain.ErrInvalidObjectID): | |||
| 56 | + | return "invalid object id" | |||
| 57 | + | case errors.Is(err, domain.ErrInvalidRevision): | |||
| 58 | + | return "invalid revision" | |||
| 59 | + | case errors.Is(err, domain.ErrInvalidPageToken): | |||
| 60 | + | return "invalid page token" | |||
| 61 | + | case errors.Is(err, domain.ErrInvalidRefKind): | |||
| 62 | + | return "invalid ref kind" | |||
| 63 | + | case errors.Is(err, domain.ErrInvalid): | |||
| 64 | + | return "invalid argument" | |||
| 55 | case errors.Is(err, context.Canceled): | 65 | case errors.Is(err, context.Canceled): | ||
| 56 | return "canceled" | 66 | return "canceled" | ||
| 57 | } | 67 | } | ||
| 58 | - | return "other" // the messages of two readers differ | 68 | + | return "other" // outside the domain errors: the messages of two readers differ |
| 59 | } | 69 | } | ||
| 60 | 70 | ||||
| 61 | // Queries are the questions put to both readers about one repository. | 71 | // Queries are the questions put to both readers about one repository. | ||