mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-10 18:56:55 +02:00
Cleaned up some validation code, stricter validation
This commit is contained in:
@@ -35,6 +35,14 @@ func ExpectNoError(t *testing.T, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
func ExpectHasError(t *testing.T, err error) {
|
||||
t.Helper()
|
||||
if errors.Is(err, nil) {
|
||||
t.Error("expected err not nil")
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
||||
func ExpectError(t *testing.T, expected error, err error) {
|
||||
t.Helper()
|
||||
if !errors.Is(err, expected) {
|
||||
|
||||
Reference in New Issue
Block a user