metadata: add checks for nil context

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-11-10 10:57:33 +03:00
parent be8d09c663
commit 51fbff3e4a
2 changed files with 15 additions and 0 deletions

View File

@@ -63,6 +63,15 @@ func TestMetadataDelete(t *testing.T) {
}
func TestNilContext(t *testing.T) {
var ctx context.Context
_, ok := FromContext(ctx)
if ok {
t.Fatal("nil context")
}
}
func TestMetadataCopy(t *testing.T) {
md := Metadata{
"Foo": "bar",