Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jordan Schalm <jordan.schalm@flowfoundation.org>
  • Loading branch information
zhangchiqing and jordanschalm authored Dec 16, 2024
1 parent a0068e1 commit 522e0f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/merr/closer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestCloseAndMergeError(t *testing.T) {

// Test case 2: only original error
err = CloseAndMergeError(closer, errors.New("original error"))
require.NotNil(t, err)
require.Error(t, err)
require.Contains(t, err.Error(), "original error")

// Test case 3: only close error
Expand All @@ -48,7 +48,7 @@ func TestCloseAndMergeError(t *testing.T) {
// Test case 5: original error is storage.ErrNotFound
err = CloseAndMergeError(closer, fmt.Errorf("not found error: %w", storage.ErrNotFound))
require.NotNil(t, err)
require.True(t, errors.Is(err, storage.ErrNotFound))
require.ErrorIs(t, err, storage.ErrNotFound)

// Test case 6: close error is storage.ErrNotFound
closer.closeError = fmt.Errorf("not found error: %w", storage.ErrNotFound)
Expand Down

0 comments on commit 522e0f3

Please sign in to comment.