Skip to content

Commit

Permalink
test: add nil context test case
Browse files Browse the repository at this point in the history
  • Loading branch information
flc1125 committed Dec 23, 2024
1 parent b8f8641 commit 56945df
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bridges/otellogr/logsink_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,13 @@ func TestLogSinkWithContext(t *testing.T) {
assert.Empty(t, rec.Result()[0].Records[0].Context())
})

t.Run("with nil context", func(t *testing.T) {
defer rec.Reset()

ls2 := ls.WithContext(nil)
assert.Same(t, ls, ls2)
})

t.Run("with context", func(t *testing.T) {
defer rec.Reset()

Expand Down

0 comments on commit 56945df

Please sign in to comment.