diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2026-04-17 14:53:52 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2026-04-17 14:53:55 +0200 |
| commit | 52f44287216b47149da9eb3f038408447f0e5981 (patch) | |
| tree | 8b81794b83d11b26e6753f65d65641b34336995c /internal/assert | |
| parent | e73aee05956d7917e7d76ab793d5e2291ace6416 (diff) | |
| download | go-oblast-52f44287216b47149da9eb3f038408447f0e5981.tar.gz | |
improve test coverage, error reporting for Select()
Diffstat (limited to 'internal/assert')
| -rw-r--r-- | internal/assert/assert.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/assert/assert.go b/internal/assert/assert.go index 26f91ff..6e641ca 100644 --- a/internal/assert/assert.go +++ b/internal/assert/assert.go @@ -4,6 +4,8 @@ package assert import ( + "cmp" + "errors" "reflect" "testing" ) @@ -26,6 +28,12 @@ func DeepEqual[V any](t testing.TB, actual, expected V) { } } +// ErrEqual is a test assertion. +func ErrEqual(t testing.TB, actual error, expected string) { + t.Helper() + Equal(t, cmp.Or(actual, errors.New("<success>")).Error(), expected) +} + // SliceEqual is a test assertion. func SliceEqual[V comparable](t testing.TB, actual []V, expected ...V) { t.Helper() |
