Skip to content

Commit

Permalink
errors.StackTrace handles nil
Browse files Browse the repository at this point in the history
  • Loading branch information
komuw committed Jun 13, 2024
1 parent f306dac commit 1a7b82c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions errors/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,15 @@ func TestStackError(t *testing.T) {
}
})
}

func TestStackTrace(t *testing.T) {
t.Parallel()

t.Run("handles nil", func(t *testing.T) {
t.Parallel()

var err error = nil
got := StackTrace(err)
attest.Equal(t, got, "")
})
}

0 comments on commit 1a7b82c

Please sign in to comment.