Skip to content

Commit

Permalink
add test case for Delete(k string)
Browse files Browse the repository at this point in the history
  • Loading branch information
coleenquadros committed Sep 19, 2023
1 parent ce3ef08 commit 4694257
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions interceptors/logging/logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,13 @@ func TestFieldsInjectExtractFromContext(t *testing.T) {
f = ExtractFields(c3)
require.Equal(t, Fields{"a", "changed", "b", "2"}, f)
}

func TestFieldsDelete(t *testing.T) {
f := Fields{"a", "1", "b", "2"}
f.Delete("a")
require.Equal(t, Fields{"b", "2"}, f)
f.Delete("b")
require.Equal(t, Fields{}, f)
f.Delete("c")
require.Equal(t, Fields{}, f)
}

0 comments on commit 4694257

Please sign in to comment.