Skip to content

Commit

Permalink
simplified tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mkbond committed May 12, 2023
1 parent c52ecbf commit cc7f46f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions errors/with_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ func TestWrapNil(t *testing.T) {
}

func TestUnwrap(t *testing.T) {
holsterErr := errors.WithContext{"some": "context"}.Wrap(context.Canceled, "external timeout")
holsterWrappedErr := errors.WithContext{"some": "othercontext"}.Wrap(holsterErr, "more text")
holsterWrappedErr := errors.WithContext{"some": "context"}.Wrap(context.Canceled, "external timeout")
assert.True(t, stderrors.Is(holsterWrappedErr, context.Canceled))

stdErr := fmt.Errorf("%w", context.Canceled)
stdWrappedErr := fmt.Errorf("%w more text", stdErr)
stdWrappedErr := fmt.Errorf("%w external timeout", context.Canceled)
assert.True(t, stderrors.Is(stdWrappedErr, context.Canceled))
}

0 comments on commit cc7f46f

Please sign in to comment.