From 2ba427dfc3ae4c3318e56f093455d5eda90a6030 Mon Sep 17 00:00:00 2001 From: Neur0toxine Date: Fri, 29 Dec 2023 11:37:01 +0300 Subject: [PATCH] test for a new func --- v1/errors_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/v1/errors_test.go b/v1/errors_test.go index 2c4bb2f..81cb600 100644 --- a/v1/errors_test.go +++ b/v1/errors_test.go @@ -64,3 +64,9 @@ func TestNewServerError(t *testing.T) { assert.NotNil(t, err.Response) } } + +func TestAsClientError(t *testing.T) { + assert.Nil(t, AsClientError(nil)) + assert.Nil(t, AsClientError(errors.New("arbitrary"))) + assert.NotNil(t, AsClientError(NewCriticalHTTPError(errors.New("arbitrary")))) +}