Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
peczenyj committed Nov 10, 2023
1 parent 1c92c62 commit b728db7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ func TestIsFunction(t *testing.T) {

err := errors.Errorf("failure: %w", io.EOF)

assert.True(t, errors.Is(io.EOF, io.EOF)) //nolint: testifylint
assert.True(t, errors.Is(err, io.EOF)) //nolint: testifylint
assert.False(t, errors.Is(err, io.ErrUnexpectedEOF)) //nolint: testifylint
assert.True(t, errors.Is(io.EOF, io.EOF))
assert.True(t, errors.Is(err, io.EOF))
assert.False(t, errors.Is(err, io.ErrUnexpectedEOF))
}

var (
Expand Down Expand Up @@ -84,7 +84,7 @@ func TestAsFunction(t *testing.T) {

var cerr *customError

require.True(t, errors.As(err, &cerr)) //nolint: testifylint
require.True(t, errors.As(err, &cerr))
assert.NotNil(t, cerr)
})

Expand All @@ -95,7 +95,7 @@ func TestAsFunction(t *testing.T) {

var terr interface{ Timeout() bool }

require.True(t, errors.As(err, &terr)) //nolint: testifylint
require.True(t, errors.As(err, &terr))
require.NotNil(t, terr)
assert.True(t, terr.Timeout())
})
Expand All @@ -122,7 +122,7 @@ func TestAsFunction_wrappingError(t *testing.T) {

var cerr *customError

require.True(t, errors.As(err, &cerr)) //nolint: testifylint
require.True(t, errors.As(err, &cerr))
assert.NotNil(t, cerr)
})

Expand All @@ -133,7 +133,7 @@ func TestAsFunction_wrappingError(t *testing.T) {

var terr interface{ Timeout() bool }

require.True(t, errors.As(err, &terr)) //nolint: testifylint
require.True(t, errors.As(err, &terr))
require.NotNil(t, terr)
assert.True(t, terr.Timeout())
})
Expand Down
3 changes: 2 additions & 1 deletion join_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package errors_test

import (
"errors"
"testing"

"github.com/peczenyj/errors"

"github.com/stretchr/testify/require"
)

Expand Down

0 comments on commit b728db7

Please sign in to comment.